
tempfile namebasenei numbasenei neighbor

************** Step 0: Check balancing for Table 1 panel C


use intermediate/confidential/data_for_analysis.dta, clear
drop __*
keep if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7

egen num_respondent = sum(cons) if dplc_s1==0, by(s_Bag_ID)
gen rate_respondent = (num_respondent/ population) *100 

keep if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7
keep if rate_respondent!=.
keep pre_intervention s_Bag_ID rate_respondent
duplicates drop 
tab pre_intervention
* just to reorder the treatment groups
gen pre_intervention2 = pre_intervention
replace pre_intervention2 = 9 if pre_intervention==7


orth_out rate_respondent using final/panelc.tex  , by(pre_intervention2) vce(robust) count se test replace stars bdec(2) latex



************** Step 1: Construct Neighbor's treatment variables






use intermediate/confidential/data_for_analysis.dta, clear

drop __*

*** Put keys to merge with zip_bag_bound_semicolon_mapmatchkey.dta

do "dofile/aux/put_mapmatchkey.do"

duplicates drop Bag_Mapmatchkey_namebase ,force
keep Bag_Mapmatchkey_namebase pre_mobile pre_disability pre_trust

merge 1:m Bag_Mapmatchkey_namebase using "intermediate/confidential/zip_bag_bound_semicolon_mapmatchkey.dta",gen(namebasemerge)
drop if namebasemerge==1

*** drop smaller polygons if more than one polygon to one subdistrict
egen maxarea = max(shape_area),by(Bag_Mapmatchkey_namebase)
keep if maxarea == shape_area
gen cons = 1
keep Bag_Mapmatchkey_namebase pre_mobile pre_disability pre_trust xcoord ycoord fid
foreach var of varlist pre_mobile pre_disability pre_trust{
	replace `var' = 0 if `var'==.
} 

save `namebasenei',replace

foreach var of varlist *{
	rename `var' `var'_nei
}

cross using `namebasenei'
drop if Bag_Mapmatchkey_namebase==Bag_Mapmatchkey_namebase_nei

geodist ycoord xcoord ycoord_nei xcoord_nei,gen(distance)

gen neighborpair = string(fid) + "+" + string(fid_nei)
merge 1:1 neighborpair using "intermediate/confidential/neighborpair.dta",gen(neighborpairmerge)
drop if neighborpairmerge==2

gen cons_nei = 1 

foreach var of varlist pre_disability_nei pre_trust_nei pre_mobile_nei cons_nei{
gen `var'50kmname = .
replace `var'50kmname = `var' if distance<=50
}


foreach var of varlist pre_disability_nei pre_trust_nei pre_mobile_nei cons_nei{
gen `var'100kmname = .
replace `var'100kmname = `var' if distance<=100
}


foreach var of varlist pre_disability_nei pre_trust_nei pre_mobile_nei cons_nei{
gen `var'20kmname = .
replace `var'20kmname = `var' if distance<=20
}


foreach var of varlist pre_disability_nei pre_trust_nei pre_mobile_nei cons_nei{
gen `var'direct = .
replace `var'direct = `var' if neighbor==1
}

collapse (sum) cons_nei*kmname cons*direct (mean) pre_*kmname  pre*direct ,by(Bag_Mapmatchkey_namebase)

foreach var of varlist *20kmname  *50kmname  *100kmname{
	replace `var' = 0 if `var'==.
}

save `namebasenei',replace






use intermediate/confidential/data_for_analysis.dta, clear

drop __*

*** Put keys to merge with zip_bag_bound_semicolon_mapmatchkey.dta

do "dofile/aux/put_mapmatchkey.do"

duplicates drop Bag_Mapmatchkey_namebase ,force
keep Bag_Mapmatchkey_namebase pre_mobile pre_disability pre_trust

merge 1:m Bag_Mapmatchkey_namebase using "intermediate/confidential/zip_bag_bound_semicolon_mapmatchkey.dta",gen(namebasemerge)
drop if namebasemerge==1



************** Step 2: Merge neighbor's treatment variable dataset with the main dataset

use intermediate/confidential/data_for_analysis.dta, clear
drop __*
drop if IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7
save intermediate/confidential/data_for_analysis_droppedfromanalysis.dta, replace

****
use intermediate/confidential/data_for_analysis.dta, clear
drop __*
keep if IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7


do "dofile/aux/put_mapmatchkey.do"
save intermediate/confidential/data_for_analysis_withbagkeytoconnectmap.dta, replace


merge m:1 Bag_Mapmatchkey_namebase using `namebasenei',gen(namebasemerge)
drop if namebasemerge==2


merge m:1 Bag_Mapmatchkey_namebase using "intermediate/confidential/zip_bag_bound_center_soumcenters.dta" ,gen(d_centerdistmerge)

drop if d_centerdistmerge==2

************** Step 3: Generate variables for analysis

rename d_centerdist cdist

gen distrust = qs5_10
drop ja_tr_dm ja_fr_dm 

foreach x of varlist  visit_all {
sum `x' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7,d
local p75 `r(p75)'
local p50 `r(p50)'
local p25 `r(p25)'

local mean `r(mean)'
gen `x'_dm2 = `x' <= `p50' if `x'!=.

* これがmean
gen `x'_dm = `x' <=  `mean' if `x'!=.
foreach y in pre_disability pre_mobile pre_trust {
gen `y'_`x'_dm  = `y'*`x'_dm 
gen `y'_`x'_dm2  = `y'*`x'_dm2 

}
}

foreach x of varlist ja_tr ja_fr cdist distrust {
sum `x' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7,d
local p75 `r(p75)'
local p50 `r(p50)'
local p25 `r(p25)'

local mean `r(mean)'
gen `x'_dm2 = `x' >= `p50' if `x'!=.

* これがmean
gen `x'_dm = `x' >=  `mean' if `x'!=.
foreach y in pre_disability pre_mobile pre_trust {
gen `y'_`x'_dm  = `y'*`x'_dm 
gen `y'_`x'_dm2  = `y'*`x'_dm2 

}
}



gen mattend = qs5_13
center mattend,prefix(sd_) s


* gen pre_treated = pre_control==0
* gen pre_treated_sd_mattend = pre_treated*sd_mattend
* gen pre_treated_highereduc3 = pre_treated*highereduc3
* gen pre_treated_pen_expect_dm = pre_treated*pen_expect_dm




foreach x in pre_disability pre_mobile pre_trust {
gen `x'_life_expect_dm 	= `x'*life_expect_dm 
gen `x'_pen_expect_dm 	= `x'*pen_expect_dm 
}



foreach x in pre_disability pre_mobile pre_trust {

foreach y in sd_mattend highereduc3{
gen `x'_`y' 	= `x'*`y' 
}
}


egen num_respondent = sum(cons) if dplc_s1==0, by(s_Bag_ID)
gen rate_respondent = (num_respondent/ population) *100 


foreach x in pre_disability pre_mobile pre_trust {
gen `x'_newcustomer 	= `x'*newcustomer 
}

label var pre_trust "Trust"
label var pre_mobile "Mobile"
label var pre_disability "Disability"
label var visit_all_dm2 "Remoteness Dummy (Frequency)"
label var cdist_dm2 "Remoteness Dummy (Distance)"

label var    pre_disability_life_expect_dm  "Disability * Expected Longevity Dummy" 
label var    pre_disability_pen_expect_dm 	 "Disability * Pension Expect Dummy"  
label var    pre_disability_ja_tr_dm 		 "Disability * Japan Trust Dummy" 
label var    pre_disability_ja_tr_dm2        "Disability * Japan Trust Dummy" 
label var    pre_disability_ja_fr_dm    "Disability * Japan Friendship Dummy" 
label var    pre_disability_visit_all_dm2 	 "Disability * Remoteness Dummy (Frequency)"
label var    pre_disability_cdist_dm2    "Disability * Remoteness Dummy (Distance)"   
label var    pre_disability_highereduc3    "Disability * Higher Education Dummy"   

* label var    pre_disability_hyperbolic 	 "Disability * Present bias Dummy"
* label var    pre_disability_future_bias 	 "Disability * Future bias Dummy"

label var    pre_trust_life_expect_dm 	 "Trust * Expected Longevity Dummy"  
label var    pre_trust_pen_expect_dm 	 "Trust * Pension Expect Dummy"  
label var    pre_trust_ja_tr_dm 		 "Trust * Japan Trust Dummy" 
label var    pre_trust_ja_tr_dm2         "Trust * Japan Trust Dummy" 
label var    pre_trust_ja_fr_dm         "Trust * Japan Friendship Dummy" 
label var    pre_trust_visit_all_dm2 	 "Trust * Remoteness Dummy (Frequency)"   
label var    pre_trust_cdist_dm2     "Trust * Remoteness Dummy (Distance)"   
label var    pre_trust_highereduc3     "Trust * Higher Education Dummy"   

* label var    pre_trust_hyperbolic 		 "Trust * Present bias Dummy"
* label var    pre_trust_future_bias 	 "Trust * Future bias Dummy" 

label var    pre_mobile_life_expect_dm  "Mobile * Expected Longevity Dummy"  
label var    pre_mobile_pen_expect_dm 	 "Mobile * Pension Expect Dummy"  
label var    pre_mobile_ja_tr_dm 		 "Mobile * Japan Trust Dummy" 
label var    pre_mobile_ja_tr_dm2        "Mobile * Japan Trust Dummy" 
label var    pre_mobile_ja_fr_dm        "Mobile * Japan Friendship Dummy" 
label var    pre_mobile_visit_all_dm2 	 "Mobile * Remoteness Dummy (Frequency)"  
label var    pre_mobile_cdist_dm2   "Mobile * Remoteness Dummy (Distance)"   
label var    pre_mobile_highereduc3   "Mobile * Higher Education Dummy"   

* label var    pre_mobile_hyperbolic 	 "Mobile * Present bias Dummy"
* label var    pre_mobile_future_bias 	 "Mobile * Future bias Dummy" 

label var ja_tr_dm "Japan Trust Dummy"
label var ja_tr_dm2 "Japan Trust Dummy"
label var ja_fr_dm "Japan Friendship Dummy"
label var    highereduc3 	 "Higher Education" 
label var p2016_dm "Any Contribution in 2016"
label var p_1mbefore "Contribution 1M Before Treatment"
label var athome "Traeted at Home"
label var riskscore "Negative Shock (1Y)"



gen injure = - qs5_16


center injure tobacco hospitalization, prefix(sd_)
gen healthshock = (sd_accident + sd_hospitalization)/2
gen unhealthy = (sd_tobacco + sd_drink) /2

center healthshock unhealthy, prefix(sd_)

gen life_expect_ng = 1 - life_expect_dm

foreach x in pre_disability pre_mobile pre_trust {
foreach y in life_expect life_expect_ng sd_healthshock sd_unhealthy sd_accident{
gen `x'_`y' 	= `x'*`y' 
}
}

label var   life_expect_dm	 "Longer Life Expectancy" 
label var   life_expect_ng	 "Shorter Life Expectancy" 

label var   sd_healthshock	 "Negative Health Shock" 
label var   sd_unhealthy	 "Unhealthy Behavior" 

label var   pre_mobile_life_expect_dm	 "Mobile * Longer Life Expectancy" 

label var   pre_mobile_life_expect_ng	 "Mobile * Shorter Life Expectancy" 
label var   pre_mobile_sd_healthshock	 "Mobile * Negative Health Shock" 
label var   pre_mobile_sd_unhealthy	 "Mobile * Unhealthy Behavior" 

label var   pre_disability_life_expect_ng	 "Disability * Shorter Life Expectancy" 

label var   pre_disability_life_expect_dm	 "Disability * Longer Life Expectancy" 
label var   pre_disability_sd_healthshock	 "Disability * Negative Health Shock" 
label var   pre_disability_sd_unhealthy	 "Disability * Unhealthy Behavior" 
label var   pre_trust_life_expect_ng	 "Trust * Shorter Life Expectancy" 

label var   pre_trust_life_expect_dm	 "Trust * Longer Life Expectancy" 
label var   pre_trust_sd_healthshock	 "Trust * Negative Health Shock" 
label var   pre_trust_sd_unhealthy	 "Trust * Unhealthy Behavior" 




label var pre_trust_neidirect "Trust in Adjacent Subdistricts (Share)"
label var pre_mobile_neidirect "Mobile in Adjacent Subdistricts (Share)"
label var pre_disability_neidirect "Disability in Adjacent Subdistricts (Share)"


label var pre_trust_nei20kmname "Trust in within-20\,km Subdistricts (Share)"
label var pre_mobile_nei20kmname "Mobile in within-20\,km Subdistricts (Share)"
label var pre_disability_nei20kmname "Disability in within-20\,km Subdistricts (Share)"

label var pre_trust_nei50kmname "Trust in within-50\,km Subdistricts (Share)"
label var pre_mobile_nei50kmname "Mobile in within-50\,km Subdistricts (Share)"
label var pre_disability_nei50kmname "Disability in within-50\,km Subdistricts (Share)"




foreach  num of numlist 3/7{
gen tmonth_`num' = s4==`num'
foreach x of varlist pre_disability pre_mobile pre_trust{
gen `x'_tmonth_`num' = `x'*tmonth_`num'
}
}

label var tmonth_3 "Treated in March"
label var tmonth_4 "Treated in April"
label var tmonth_5 "Treated in May"
label var tmonth_6 "Treated in June"
label var tmonth_7 "Treated in July"


foreach var of varlist s4 athome p_1mbefore p2016_dm highereduc3  female age job visit_all_dm2 students herder self_employed jobless cdist_dm2  healthshock unhealthy life_expect_dm ja_tr_dm ja_fr_dm tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 {
gen `var'_mv = `var'
replace `var'_mv = 0 if `var' == .

gen `var'_mvdum = `var' == .

}




foreach x in pre_disability pre_mobile pre_trust {
foreach y of varlist highereduc3_mv*{
gen `x'_`y' 	= `x'*`y' 
}
}


sum qs5_4* if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7


gen p_5change = p_5mafter - p_1mbefore

gen toooldtostartpay = (age>=45&female==0)|(age>=40&female==1) if age!=.



gen educ_tocomp = qs4_5
replace educ_tocomp = 9 if educ_tocomp==10

gen mobilephone = qs1_5==1 if qs1_5!=.

center educ_tocomp age qs4_15_d qs4_15_e , prefix(c_)
center educ_tocomp age qs4_15_d qs4_15_e , prefix(sd_) s


foreach x in pre_disability pre_mobile pre_trust {
foreach y in educ_tocomp age qs4_15_d qs4_15_e {
gen `x'_c_`y' 	= `x'*c_`y' 
}
}

foreach x in pre_disability pre_mobile pre_trust {
foreach y in educ_tocomp age qs4_15_d qs4_15_e {
gen `x'_sd_`y' 	= `x'*sd_`y' 
}
}


foreach x in pre_disability pre_mobile pre_trust {
foreach y in mobilephone hospitalization{
gen `x'_`y' 	= `x'*`y' 
}
}


***  610451 was duplicated
*** )

merge m:1 s_Bag_ID using "rawdata/aux/soumcenter_final.dta" ,nogen

replace d_center = 0 if d_center==.

foreach x in pre_disability pre_mobile pre_trust {
gen `x'_d_center 	= `x'*d_center 
}


*
foreach n of numlist 0/9{
gen p_`n'mafter_s2 = .
foreach month of numlist 4/12{
replace p_`n'mafter_s2 = p2017_`month'_s2 if s4 + `n' == `month'
}
}

foreach n of numlist 1/9{
gen p_`n'mbefore_s2 = .
foreach month of numlist 1/9{
replace p_`n'mbefore_s2 = p2017_`month'_s2 if s4 - `n' == `month'
}
}


forvalues x=2006/2017 {
gen p`x'_dm_s2=p`x'_s2>0 & p`x'_s2<. 
}




label var    pre_disability_d_center  "Disability * District Center" 
label var    pre_trust_d_center 	 "Trust * District Center"  
label var    pre_mobile_d_center  "Mobile * District Center"  


label var    pre_disability_c_educ_tocomp  "Disability * Education" 
label var    pre_trust_c_educ_tocomp 	 "Trust * Education"  
label var    pre_mobile_c_educ_tocomp  "Mobile * Education"  

label var    pre_disability_c_age  "Disability * Age" 
label var    pre_trust_c_age 	 "Trust * Age"  
label var    pre_mobile_c_age  "Mobile * Age"  

label var    pre_disability_mobilephone  "Disability * Mobile Phone Dummy" 
label var    pre_trust_mobilephone 	 "Trust * Mobile Phone Dummy"  
label var    pre_mobile_mobilephone  "Mobile * Mobile Phone Dummy"  


label var    pre_disability_distrust_dm  "Disability * Pension Distrust" 
label var    pre_trust_distrust_dm 	 "Trust * Pension Distrust"  
label var    pre_mobile_distrust_dm  "Mobile * Pension Distrust"  
label var    distrust_dm  "Pension Distrust"  







label var age "Age"
label var female "Female"
label var highereduc3 "Higher Education"
label var herder "Herder"
label var self_employed "Self-employed"

label var students "Student"
label var jobless "Unemployed"

label var p2016_dm  "Any Payment in 2016"
label var p_1mbefore "Payment 1M before the Experiment"
label var visit_all_dm2 "Remoteness Dummy (Frequency)"
label var healthshock "Negative Health Shock"
label var unhealthy "Unhealthy Behavior"
label var life_expect_dm "Expected Longevity Dummy"
label var ja_tr_dm "Japan Trust Dummy"
label var s4 "Treatment Month"
label var athome "Treatment at Home"

label var pre_disability_sd_mattend "Disability * Attendance in 2016"
label var pre_trust_sd_mattend "Trust * Attendance in 2016"
label var pre_mobile_sd_mattend "Mobile * Attendance in 2016"
* label var pre_treated_sd_mattend "Traeted * Attendance in 2016"
* label var pre_treated_pen_expect_dm    "Traeted * Pension Expect Dummy"  





gen age_gd28 = age <= 28 if age!=.
gen age_gd33 = age <= 33 & age > 28 if age!=.
gen age_gd38 = age <= 38 & age > 33 if age!=.
gen age_gd43 = age <= 43 & age > 38 if age!=.
gen age_gd48 = age <= 48 & age > 43 if age!=.
gen age_gd53 = age > 48 if age!=.


foreach var of varlist pre_disability pre_mobile pre_trust{
	foreach age of varlist age_gd*{
gen `var'_`age'= `var'*`age'
}
}

label var pre_disability_age_gd28 "Disability * $<=$ 28 Years Old"
label var pre_disability_age_gd33 "Disability * 29--33 Years Old"
label var pre_disability_age_gd38 "Disability * 34--38 Years Old"
label var pre_disability_age_gd43 "Disability * 39--43 Years Old"
label var pre_disability_age_gd48 "Disability * 44--48 Years Old"
label var pre_disability_age_gd53 "Disability * $>$ 48 Years Old"


label var pre_mobile_age_gd28 "Mobile * $<=$ 28 Years Old"
label var pre_mobile_age_gd33 "Mobile * 29--33 Years Old"
label var pre_mobile_age_gd38 "Mobile * 34--38 Years Old"
label var pre_mobile_age_gd43 "Mobile * 39--43 Years Old"
label var pre_mobile_age_gd48 "Mobile * 44--48 Years Old"
label var pre_mobile_age_gd53 "Mobile * $>$ 48 Years Old"


label var pre_trust_age_gd28 "Trust * $<=$ 28 Years Old"
label var pre_trust_age_gd33 "Trust * 29--33 Years Old"
label var pre_trust_age_gd38 "Trust * 34--38 Years Old"
label var pre_trust_age_gd43 "Trust * 39--43 Years Old"
label var pre_trust_age_gd48 "Trust * 44--48 Years Old"
label var pre_trust_age_gd53 "Trust * $>$ 48 Years Old"





foreach var of varlist qs4_12{
gen `var'_mv = `var'
replace `var'_mv = 0 if `var' >10

gen `var'_mvdum = `var' == .

}

tab qs4_12,gen(incomegroup_)

foreach var of varlist  pre_disability pre_mobile pre_trust{
gen `var'_incomegroup_1= `var'*incomegroup_1
gen `var'_incomegroup_2= `var'*incomegroup_2
gen `var'_incomegroup_3= `var'*incomegroup_3
gen `var'_incomegroup_4= `var'*incomegroup_4
gen `var'_incomegroup_5= `var'*incomegroup_5
* gen `var'_incomegroup_6= `var'*incomegroup_6

}

* Main Result *different eststo


foreach var of varlist pre_disability pre_mobile pre_trust{
gen `var'_athome= `var'*athome
}


label var pre_disability_athome "Disability * Treatment at Home"
label var pre_mobile_athome "Mobile * Treatment at Home"
label var pre_trust_athome "Trust * Treatment at Home"

foreach num of numlist 18/59{
	gen agedm_`num' = age == `num' if age!=.
	gen agefdm_`num' = age == `num' & female == 1 if age!=.
	gen agemdm_`num' = age == `num' & female == 0 if age!=.

	foreach x of varlist pre_disability pre_mobile pre_trust{
		gen `x'_agedm_`num' = `x' * agedm_`num'
		gen `x'_agefdm_`num' = `x' * agefdm_`num'
		gen `x'_agemdm_`num' = `x' * agemdm_`num'

	}
}


save intermediate/confidential/finaldata.dta,replace

************** Step 4: Analysis

use intermediate/confidential/finaldata.dta,clear

local unbalance_ind "highereduc3_mv* visit_all_dm2_mv* i.job_mv*"
local howexperiment "i.s4_mv* athome_mv*"
local other_ind "female_mv* age_mv*"

foreach var of varlist highereduc3_mv* visit_all_dm2_mv* s4_mv* female_mv* job_mv* age_mv*{
	gen athome_`var' = athome*`var'
}

*controlmean, controlmeanex, controlmeannever, controlmeanexisting, controlmeanspouse

tab p_5mafter if  pre_treated==0 &IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
tab p_5mafter if  pre_treated==0 &IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 & newcustomer==0
tab p_5mafter if  pre_treated==0 &IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 & newcustomer==1
tab p_5mafter_s2 if  pre_treated==0 &IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 

tab p_5mafter if  p_1mbefore_s2!=.&	pre_treated==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 

* nojoinreasons
sum qs5_4* if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 & newcustomer==1
* noexpectfuturepayment
tab qs5_10 if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 & newcustomer==1


* see 4 and 16 4: 17% 
tab visit_all if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 

* footnote 11
tab qs1_5 if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
tab qs4_6 if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 

* p18 paymentdropinthecontrol
tab p_1mbefore if pre_treated==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
tab p_5mafter if  pre_treated==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 

* appendix table controlmeanone and controlmeanthree
tab p_1mafter if  pre_treated==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
tab p_3mafter if  pre_treated==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 

* p19
tab p_1mbefore if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
tab newcustomer if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
*
sum cdist  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,d

* maineffectprop
disp 1.48/15.30 
disp 1.50/15.30 
disp 1.52/15.30 
disp 1.56/15.30 

* footnote 17

gen notwrongid = IDmt1 ==1 & dplc_s1==0 if vol==1  & s4>=3&s4<=7 
reg age notwrongid
reg highereduc3 notwrongid

* appendix table

tab pen_expect_dm if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
tab ja_tr_dm if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
tab ja_fr_dm if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
tab pen_expect_dm if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
tab visit_all_dm2 if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 
tab cdist_dm2 if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 


* Descriptive Statistics
* Balancing Test Using Survey Data

eststo clear
foreach var of varlist athome tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 {
    areg    `var' pre_disability pre_mobile pre_trust   i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
    eststo `var'
    estadd ysumm
    test  pre_trust = pre_disability = pre_mobile = 0
    estadd scalar p = r(p)
}
esttab, se nostar stats(ymean ysd p N) keep(pre_disability pre_mobile pre_trust)


matrix C = r(coefs)

matrix S = r(stats)

eststo clear

local rnames : rownames C

local models : coleq C

local models : list uniq models

local i 0

foreach name of local rnames {
 local ++i
 local j 0
 capture matrix drop b
 capture matrix drop se
 foreach model of local models {
    local lab: variable label `model'
     local ++j
     matrix tmp = C[`i', 2*`j'-1]
     if tmp[1,1]<. {
         matrix colnames tmp = "`lab'"
         matrix b = nullmat(b), tmp
         matrix tmp[1,1] = C[`i', 2*`j']
         matrix se = nullmat(se), tmp
     }
 }
 ereturn post b
 quietly estadd matrix se
 eststo `name'
}

local snames : rownames S

local i 0

foreach name of local snames {
 local ++i
 local j 0
 capture matrix drop b
 foreach model of local models {
    local lab: variable label `model'
     local ++j
     matrix tmp = S[`i', `j']
     matrix colnames tmp = "`lab'"
     matrix b = nullmat(b), tmp
 }
 ereturn post b
 eststo `name'
}

esttab using "final/balancing_horizontalbody_treatmentmonth.tex", se  noobs compress nonumb replace nogap starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap 
 


eststo clear
foreach var of varlist age female highereduc3 herder self_employed students jobless p2016_dm p_1mbefore visit_all_dm2 cdist_dm2 healthshock unhealthy life_expect_dm ja_tr_dm ja_fr_dm {
	areg  	`var' pre_disability pre_mobile pre_trust   i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
	eststo `var'
	estadd ysumm
	test  pre_trust = pre_disability = pre_mobile = 0
	estadd scalar p = r(p)
}
esttab, se nostar stats(ymean ysd p  N) keep(pre_disability pre_mobile pre_trust)


* Balancing Test Using Survey Data
matrix C = r(coefs)

matrix S = r(stats)

eststo clear

local rnames : rownames C

local models : coleq C

local models : list uniq models

local i 0

foreach name of local rnames {
 local ++i
 local j 0
 capture matrix drop b
 capture matrix drop se
 foreach model of local models {
 	local lab: variable label `model'
     local ++j
     matrix tmp = C[`i', 2*`j'-1]
     if tmp[1,1]<. {
         matrix colnames tmp = "`lab'"
         matrix b = nullmat(b), tmp
         matrix tmp[1,1] = C[`i', 2*`j']
         matrix se = nullmat(se), tmp
     }
 }
 ereturn post b
 quietly estadd matrix se
 eststo `name'
}

local snames : rownames S

local i 0

foreach name of local snames {
 local ++i
 local j 0
 capture matrix drop b
 foreach model of local models {
 	local lab: variable label `model'
     local ++j
     matrix tmp = S[`i', `j']
     matrix colnames tmp = "`lab'"
     matrix b = nullmat(b), tmp
 }
 ereturn post b
 eststo `name'
}

esttab using "final/balancing_horizontal.tex", se mtitle noobs compress nonumb replace
esttab using "final/balancing_horizontalbody.tex", se  noobs compress nonumb replace nogap starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap 

eststo clear
eststo: areg  pre_disability age_mv* female_mv* highereduc3_mv* herder_mv* self_employed_mv* students_mv* jobless_mv* p2016_dm_mv* p_1mbefore_mv* visit_all_dm2_mv* cdist_dm2_mv* healthshock_mv* unhealthy_mv* life_expect_dm_mv* ja_tr_dm_mv* ja_fr_dm_mv* tmonth_*_mv*   i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
test age_mv=female_mv=highereduc3_mv=herder_mv=self_employed_mv=students_mv=p2016_dm_mv=p_1mbefore_mv=visit_all_dm2_mv=cdist_dm2_mv=healthshock_mv=unhealthy_mv=life_expect_dm_mv=ja_tr_dm_mv=ja_fr_dm_mv=tmonth_3_mv=tmonth_4_mv=tmonth_5_mv=tmonth_6_mv==tmonth_7_mv=0
estadd scalar F_diff = r(p)

test age_mv=female_mv=p_1mbefore_mv=cdist_dm2_mv=healthshock_mv=unhealthy_mv=life_expect_dm_mv=ja_tr_dm_mv=ja_fr_dm_mv=0
estadd scalar F_diff2 = r(p)

eststo: areg  pre_mobile age_mv* female_mv* highereduc3_mv* herder_mv* self_employed_mv* students_mv* jobless_mv* p2016_dm_mv* p_1mbefore_mv* visit_all_dm2_mv* cdist_dm2_mv* healthshock_mv* unhealthy_mv* life_expect_dm_mv* ja_tr_dm_mv* ja_fr_dm_mv* tmonth_*_mv*   i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
test age_mv=female_mv=highereduc3_mv=herder_mv=self_employed_mv=students_mv=p2016_dm_mv=p_1mbefore_mv=visit_all_dm2_mv=cdist_dm2_mv=healthshock_mv=unhealthy_mv=life_expect_dm_mv=ja_tr_dm_mv=ja_fr_dm_mv=tmonth_3_mv=tmonth_4_mv=tmonth_5_mv=tmonth_6_mv==tmonth_7_mv=0
estadd scalar F_diff = r(p)
test age_mv=female_mv=p_1mbefore_mv=cdist_dm2_mv=healthshock_mv=unhealthy_mv=life_expect_dm_mv=ja_tr_dm_mv=ja_fr_dm_mv=0
estadd scalar F_diff2 = r(p)

eststo: areg  pre_trust age_mv* female_mv* highereduc3_mv* herder_mv* self_employed_mv* students_mv* jobless_mv* p2016_dm_mv* p_1mbefore_mv* visit_all_dm2_mv* cdist_dm2_mv* healthshock_mv* unhealthy_mv* life_expect_dm_mv* ja_tr_dm_mv* ja_fr_dm_mv* tmonth_*_mv*   i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
test age_mv=female_mv=highereduc3_mv=herder_mv=self_employed_mv=students_mv=p2016_dm_mv=p_1mbefore_mv=visit_all_dm2_mv=cdist_dm2_mv=healthshock_mv=unhealthy_mv=life_expect_dm_mv=ja_tr_dm_mv=ja_fr_dm_mv=tmonth_3_mv=tmonth_4_mv=tmonth_5_mv=tmonth_6_mv==tmonth_7_mv=0
estadd scalar F_diff = r(p)
test age_mv=female_mv=p_1mbefore_mv=cdist_dm2_mv=healthshock_mv=unhealthy_mv=life_expect_dm_mv=ja_tr_dm_mv=ja_fr_dm_mv=0
estadd scalar F_diff2 = r(p)
return clear

eststo: reg cons 
eststo
eststo
eststo
estadd scalar F_diff = 12712

esttab using "final/balancing_verticalftest.tex", se  noobs compress nonumb replace nogap starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap drop(*) stats(F_diff, labels("Joint F-Test P-Value (Overall)"))

***


* gen dropsample = 1
* replace dropsample = 0 if IDmt1==1&dplc_s1==0

* eststo clear
* foreach var of varlist age female highereduc3 herder p2016_dm p_1mbefore {
* 	eststo: areg  	`var' dropsample   i.strata if   vol==1 & s4>=3&s4<=7,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
* 	estadd scalar p = r(p)
* }

* esttab  using "final/balancing_dropsample.tex", replace se b(%5.4f) r2 label nogaps scalar("p Join F-Test p-value ") starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= *strata" "District Fixed Effects= _cons" ) title(Simple regression in full sample)
* eststo clear
* foreach var of varlist visit_all_dm2 healthshock unhealthy  life_expect_dm ja_tr_dm s4 athome{
* 	eststo: areg  	`var' dropsample   i.strata if   vol==1 & s4>=3&s4<=7,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
* 	estadd scalar p = r(p)
* }

* esttab  using "final/balancing_dropsample.tex", append se b(%5.4f) r2 label nogaps scalar("p Join F-Test p-value ") starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= *strata" "District Fixed Effects= _cons" ) title(Simple regression in full sample)

* 			   *


***** Main Figure


foreach type in "existing" "never" "full" {
if "`type'"=="never"{
	local cond "newcustomer==1&"
}
else if "`type'"=="existing"{
	local cond "newcustomer==0&"
}
else {
	local cond ""
}
estimates clear
eststo clear
local i = 1
foreach var of varlist p_2mbefore p_1mbefore  p_0mafter p_1mafter p_2mafter p_3mafter p_4mafter p_5mafter p_6mafter p_7mafter{
	eststo: areg `var' pre_disability pre_mobile pre_trust  i.strata p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
	reg `var' pre_disability pre_mobile pre_trust  i.strata p_3mbefore p2016_dm `unbalance_ind' `howexperiment' i.s_Soum_ID if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 
	est store `var'
}
suest p_1mafter p_7mafter, cluster(s_Bag_ID)
test [p_1mafter_mean = p_7mafter_mean]: pre_disability
local dis = `r(p)'
local dis = string(`dis', "%3.2f")
test [p_1mafter_mean = p_7mafter_mean]: pre_mobile
local mob = `r(p)'
local mob = string(`mob', "%3.2f")

test [p_1mafter_mean = p_7mafter_mean]: pre_trust
local tru = `r(p)'
local tru = string(`tru', "%3.2f")



coefplot est*, legend(off) keep(pre_*) vertical  asequation swapnames rename(pre_disability = Disability pre_mobile= Mobile pre_trust = Trust ) eqrename(est1 = "-2M" est2 = "-1M" est3 = "0M" est4 = "+1M" est5 = "+2M" est6 = "+3M" est7 = "+4M" est8 = "+5M" est9 = "+6M" est10 = "+7M") xlabel( ,alternate ) label yscale(range(-0.04 0.07)) ylabel(-0.04(0.02)0.06) text(0.06 6 "+1M=+7M: `dis'"  0.06  17  "+1M=+7M: `mob'" 0.06  28  "+1M=+7M: `tru'", size(large)   )
graph export "final/eventstudy_`type'.eps",replace
}

***** Appendix Figure

foreach type in "existing" "never" "full" {
if "`type'"=="never"{
	local cond "newcustomer==1&"
}
else if "`type'"=="existing"{
	local cond "newcustomer==0&"
}
else {
	local cond ""
}
estimates clear
eststo clear
local i = 1
foreach var of varlist p_2mbefore p_1mbefore  p_0mafter p_1mafter p_2mafter p_3mafter p_4mafter p_5mafter p_6mafter p_7mafter{
	eststo: areg `var'     pre_disability pre_mobile pre_trust pre_disability pre_disability_cdist_dm2 pre_mobile pre_mobile_cdist_dm2 pre_trust pre_trust_cdist_dm2 cdist_dm2 i.strata p2016_dm i.strata p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
	* estimates store est`i'
	reg `var'     pre_disability pre_mobile pre_trust pre_disability pre_disability_cdist_dm2 pre_mobile pre_mobile_cdist_dm2 pre_trust pre_trust_cdist_dm2 cdist_dm2 i.strata p2016_dm i.strata p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 
	est store `var'
	local i = `i'+1
}
suest p_1mafter p_7mafter, cluster(s_Bag_ID)
test [p_1mafter_mean = p_7mafter_mean]: pre_disability_cdist_dm2
local dis = `r(p)'
local dis = string(`dis', "%3.2f")
test [p_1mafter_mean = p_7mafter_mean]: pre_mobile_cdist_dm2
local mob = `r(p)'
local mob = string(`mob', "%3.2f")

test [p_1mafter_mean = p_7mafter_mean]: pre_trust_cdist_dm2
local tru = `r(p)'
local tru = string(`tru', "%3.2f")

coefplot est*, legend(off) keep(pre_*dm2) vertical  asequation swapnames rename(pre_disability_cdist_dm2 = Disability*Remoteness pre_mobile_cdist_dm2 = Mobile*Remoteness pre_trust_cdist_dm2 = Trust*Remoteness ) eqrename(est1 = "-2M" est2 = "-1M" est3 = "0M" est4 = "+1M" est5 = "+2M" est6 = "+3M" est7 = "+4M" est8 = "+5M" est9 = "+6M" est10 = "+7M") xlabel( ,alternate ) label yscale(range(-0.15 0.1)) ylabel(-0.15(0.05)0.1) text(1 6 "+1M=+7M: `dis'"  1  17  "+1M=+7M: `mob'" 1  28  "+1M=+7M: `tru'", size(large)   )
graph export "final/eventstudy_cdistdm2_`type'.eps",replace
}


foreach type in "existing" "never" "full" {
if "`type'"=="never"{
	local cond "newcustomer==1&"
}
else if "`type'"=="existing"{
	local cond "newcustomer==0&"
}
else {
	local cond ""
}
estimates clear
eststo clear
local i = 1
foreach var of varlist p_2mbefore p_1mbefore  p_0mafter p_1mafter p_2mafter p_3mafter p_4mafter p_5mafter p_6mafter p_7mafter{
	eststo: areg `var'     pre_disability pre_mobile pre_trust pre_disability pre_disability_visit_all_dm2 pre_mobile pre_mobile_visit_all_dm2 pre_trust pre_trust_visit_all_dm2 visit_all_dm2 i.strata p2016_dm i.strata p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
	* estimates store est`i'
	reg `var'     pre_disability pre_mobile pre_trust pre_disability pre_disability_visit_all_dm2 pre_mobile pre_mobile_visit_all_dm2 pre_trust pre_trust_visit_all_dm2 visit_all_dm2 i.strata p2016_dm i.strata p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8
	est store `var'
	local i = `i'+1
}

suest p_1mafter p_7mafter, cluster(s_Bag_ID)
test [p_1mafter_mean = p_7mafter_mean]: pre_disability_visit_all_dm2
local dis = `r(p)'
local dis = string(`dis', "%3.2f")
test [p_1mafter_mean = p_7mafter_mean]: pre_mobile_visit_all_dm2
local mob = `r(p)'
local mob = string(`mob', "%3.2f")

test [p_1mafter_mean = p_7mafter_mean]: pre_trust_visit_all_dm2
local tru = `r(p)'
local tru = string(`tru', "%3.2f")


coefplot est*, legend(off) keep(pre_*dm2) vertical  asequation swapnames rename(pre_disability_visit_all_dm2 = Disability*Remoteness pre_mobile_visit_all_dm2 = Mobile*Remoteness pre_trust_visit_all_dm2 = Trust*Remoteness ) eqrename(est1 = "-2M" est2 = "-1M" est3 = "0M" est4 = "+1M" est5 = "+2M" est6 = "+3M" est7 = "+4M" est8 = "+5M" est9 = "+6M" est10 = "+7M") xlabel( ,alternate )  label yscale(range(-0.15 0.1)) ylabel(-0.15(0.05)0.1) text(0.1 6 "+1M=+7M: `dis'"  0.1  17  "+1M=+7M: `mob'" 0.1  28  "+1M=+7M: `tru'", size(large)   )
graph export "final/eventstudy_visitalldm2_`type'.eps",replace
}


**** Another Figure 


foreach type in "existing" "never" "full" {
if "`type'"=="never"{
	local cond "newcustomer==1&"
}
else if "`type'"=="existing"{
	local cond "newcustomer==0&"
}
else {
	local cond ""
}
estimates clear
eststo clear
local i = 1
foreach var of varlist p_2mbefore p_1mbefore  p_0mafter p_1mafter p_2mafter p_3mafter p_4mafter p_5mafter p_6mafter p_7mafter{
	eststo: areg `var'   pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm i.s_Soum_ID p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
	* estimates store est`i'
	reg `var'   pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm i.s_Soum_ID p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 
	est store `var'
	local i = `i'+1
}

suest p_1mafter p_7mafter, cluster(s_Bag_ID)
test [p_1mafter_mean = p_7mafter_mean]: pre_disability_ja_tr_dm
local dis = `r(p)'
local dis = string(`dis', "%3.2f")
test [p_1mafter_mean = p_7mafter_mean]: pre_mobile_ja_tr_dm
local mob = `r(p)'
local mob = string(`mob', "%3.2f")

test [p_1mafter_mean = p_7mafter_mean]: pre_trust_ja_tr_dm
local tru = `r(p)'
local tru = string(`tru', "%3.2f")

coefplot est*, legend(off) keep(pre_*dm) vertical  asequation swapnames rename(pre_disability_ja_tr_dm = "Disability*Japan Trust" pre_mobile_ja_tr_dm = "Mobile*Japan Trust" pre_trust_ja_tr_dm = "Trust*Japan Trust") eqrename(est1 = "-2M" est2 = "-1M" est3 = "0M" est4 = "+1M" est5 = "+2M" est6 = "+3M" est7 = "+4M" est8 = "+5M" est9 = "+6M" est10 = "+7M") xlabel( ,alternate )  label yscale(range(-0.12 0.2)) ylabel(-0.1(0.05)0.2) text(0.2 6 "+1M=+7M: `dis'"  0.2  17  "+1M=+7M: `mob'" 0.2  28  "+1M=+7M: `tru'", size(large)   ) 
graph export "final/eventstudy_japantrust_`type'.eps",replace
}


foreach type in "existing" "never" "full" {
if "`type'"=="never"{
	local cond "newcustomer==1&"
}
else if "`type'"=="existing"{
	local cond "newcustomer==0&"
}
else {
	local cond ""
}
estimates clear
eststo clear
local i = 1
foreach var of varlist p_2mbefore p_1mbefore  p_0mafter p_1mafter p_2mafter p_3mafter p_4mafter p_5mafter p_6mafter p_7mafter{
	eststo: areg `var'   pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm i.s_Soum_ID p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
	* estimates store est`i'
	reg `var'   pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm i.s_Soum_ID p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8
	est store `var'
	local i = `i'+1
}

suest p_1mafter p_7mafter, cluster(s_Bag_ID)
test [p_1mafter_mean = p_7mafter_mean]: pre_disability_ja_fr_dm
local dis = `r(p)'
local dis = string(`dis', "%3.2f")
test [p_1mafter_mean = p_7mafter_mean]: pre_mobile_ja_fr_dm
local mob = `r(p)'
local mob = string(`mob', "%3.2f")

test [p_1mafter_mean = p_7mafter_mean]: pre_trust_ja_fr_dm
local tru = `r(p)'
local tru = string(`tru', "%3.2f")

coefplot est*, legend(off) keep(pre_*dm) vertical  asequation swapnames rename(pre_disability_ja_fr_dm = "Disability*Japan Friendship" pre_mobile_ja_fr_dm = "Mobile*Japan Friendship" pre_trust_ja_fr_dm = "Trust*Japan Friendship") eqrename(est1 = "-2M" est2 = "-1M" est3 = "0M" est4 = "+1M" est5 = "+2M" est6 = "+3M" est7 = "+4M" est8 = "+5M" est9 = "+6M" est10 = "+7M") xlabel( ,alternate )  label yscale(range(-0.12 0.2)) ylabel(-0.1(0.05)0.2) text(0.2 6 "+1M=+7M: `dis'"  0.2  17  "+1M=+7M: `mob'" 0.2  28  "+1M=+7M: `tru'", size(large)   ) 
graph export "final/eventstudy_japanfriend_`type'.eps",replace
}



foreach type in "existing" "never" "full" {
if "`type'"=="never"{
	local cond "newcustomer==1&"
}
else if "`type'"=="existing"{
	local cond "newcustomer==0&"
}
else {
	local cond ""
}
estimates clear
eststo clear
local i = 1
foreach var of varlist p_2mbefore p_1mbefore  p_0mafter p_1mafter p_2mafter p_3mafter p_4mafter p_5mafter p_6mafter p_7mafter{
	eststo: areg `var'   pre_disability pre_disability_pen_expect_dm pre_mobile pre_mobile_pen_expect_dm pre_trust pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
	* estimates store est`i'
	reg `var'   pre_disability pre_disability_pen_expect_dm pre_mobile pre_mobile_pen_expect_dm pre_trust pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_3mbefore p2016_dm `unbalance_ind' `howexperiment' if  `cond'p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 
	est store `var'
	local i = `i'+1
}

suest p_1mafter p_7mafter, cluster(s_Bag_ID)
test [p_1mafter_mean = p_7mafter_mean]: pre_disability_pen_expect_dm
local dis = `r(p)'
local dis = string(`dis', "%3.2f")
test [p_1mafter_mean = p_7mafter_mean]: pre_mobile_pen_expect_dm
local mob = `r(p)'
local mob = string(`mob', "%3.2f")

test [p_1mafter_mean = p_7mafter_mean]: pre_trust_pen_expect_dm
local tru = `r(p)'
local tru = string(`tru', "%3.2f")

coefplot est*, legend(off) keep(pre_*pen_expect_dm) vertical  asequation swapnames rename(pre_disability_pen_expect_dm = "Disability*Pension Expect" pre_mobile_pen_expect_dm = "Mobile*Pension Expect" pre_trust_pen_expect_dm = "Trust*Pension Expect")  eqrename(est1 = "-2M" est2 = "-1M" est3 = "0M" est4 = "+1M" est5 = "+2M" est6 = "+3M" est7 = "+4M" est8 = "+5M" est9 = "+6M" est10 = "+7M") xlabel( ,alternate )  label yscale(range(-0.12 0.2)) ylabel(-0.1(0.05)0.2) text(0.2 6 "+1M=+7M: `dis'"  0.2  17  "+1M=+7M: `mob'" 0.2  28  "+1M=+7M: `tru'", size(large)   ) 
graph export "final/eventstudy_penexpect_`type'.eps",replace
}





* Main Result *different eststo

eststo clear
eststo: areg p_5mafter pre_disability pre_mobile pre_trust   if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
test pre_disability=  pre_mobile 
estadd scalar dismob = `r(p)': est1
test pre_disability=  pre_trust
estadd scalar distrus = `r(p)': est1
test pre_mobile=  pre_trust
estadd scalar mobtrus = `r(p)': est1


sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) reg p_5mafter pre_disability pre_mobile pre_trust  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro  cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est1
estadd scalar rpint2 = test[2,5]: est1
estadd scalar rpint3 = test[3,5]: est1


eststo: reg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm  i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro  cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
test pre_disability=  pre_mobile 
estadd scalar dismob = `r(p)': est2
test pre_disability=  pre_trust
estadd scalar distrus = `r(p)': est2
test pre_mobile=  pre_trust
estadd scalar mobtrus = `r(p)': est2

qui sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) reg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro  cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2
estadd scalar rpint2 = test[2,5]: est2
estadd scalar rpint3 = test[3,5]: est2

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
test pre_disability=  pre_mobile 
estadd scalar dismob = `r(p)': est3
test pre_disability=  pre_trust
estadd scalar distrus = `r(p)': est3
test pre_mobile=  pre_trust
estadd scalar mobtrus = `r(p)': est3

qui sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm  i.s_Soum_ID if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
estadd scalar rpint2 = test[2,5]: est3
estadd scalar rpint3 = test[3,5]: est3

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
test pre_disability=  pre_mobile 
estadd scalar dismob = `r(p)': est4
test pre_disability=  pre_trust
estadd scalar distrus = `r(p)': est4
test pre_mobile=  pre_trust
estadd scalar mobtrus = `r(p)': est4
qui sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4
estadd scalar rpint2 = test[2,5]: est4
estadd scalar rpint3 = test[3,5]: est4


eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
test pre_disability=  pre_mobile 
estadd scalar dismob = `r(p)': est5
test pre_disability=  pre_trust
estadd scalar distrus = `r(p)': est5
test pre_mobile=  pre_trust
estadd scalar mobtrus = `r(p)': est5
qui sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est5
estadd scalar rpint2 = test[2,5]: est5
estadd scalar rpint3 = test[3,5]: est5




eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' `other_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
test pre_disability=  pre_mobile 
estadd scalar dismob = `r(p)': est6
test pre_disability=  pre_trust
estadd scalar distrus = `r(p)': est6
test pre_mobile=  pre_trust
estadd scalar mobtrus = `r(p)': est6
qui sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' `other_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6
estadd scalar rpint2 = test[2,5]: est6
estadd scalar rpint3 = test[3,5]: est6



esttab  using "final/main.tex", replace scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Female = female*" "Age = age*"  ) 
esttab  using "final/main_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_trust pre_mobile)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
* esttab  using "final/main_foot.tex", replace scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= *s_Soum_ID"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Treatment Month Dummies = *s4" "Treatment at Home = athome" "Female= *female" "Age= age" "Occupation Dummies= *job") 
esttab  using "final/main_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/main_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Female = female*" "Age = age*"   ) 
esttab  using "final/main_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1  rpint2 rpint3 dismob distrus mobtrus N ncluster,labels("Rand-t for Disability" "Rand-t for Mobile" "Rand-t for Trust" "Disability $=$ Mobile" "Disability $=$ Trust" "Mobile $=$ Trust" "Observations" "N of Subdistricts"))

* Short-Term Effects


eststo clear
eststo: areg p_1mafter 		pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' if  p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo: areg p_1mafter 		pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo: areg p_1mafter 		pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind'  if  p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo: areg p_3mafter 		pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' if  p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo: areg p_3mafter 		pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo: areg p_3mafter 		pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind'  if  p_5mafter!=.&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, 			ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)




esttab  using "final/main_otherlength.tex", replace se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= *strata" "District Fixed Effects= _cons"  "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"  "Female= *female*" "Age= age*" ) 
esttab  using "final/main_otherlength_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_trust pre_mobile)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/main_otherlength_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/main_otherlength_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= *strata"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm"  "District Fixed Effects= _cons" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"  "Female= *female*" "Age= age*" ) 
esttab  using "final/main_otherlength_foot.tex" , append   se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(N ncluster,labels("Observations" "N of Subdistricts"))




* Main Result with treatmentmonth heterogeneity *特殊indicate

eststo clear
eststo: areg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


randcmd ((pre_disability pre_mobile pre_trust ) reg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro  cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est1
estadd scalar rpint2 = test[2,5]: est1
estadd scalar rpint3 = test[3,5]: est1


eststo: reg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 p_1mbefore p2016_dm  i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro  cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


randcmd ((pre_disability pre_mobile pre_trust ) reg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 p_1mbefore p2016_dm i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro  cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2
estadd scalar rpint2 = test[2,5]: est2
estadd scalar rpint3 = test[3,5]: est2

eststo: areg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 p_1mbefore p2016_dm i.s_Soum_ID if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 p_1mbefore p2016_dm  i.s_Soum_ID if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
estadd scalar rpint2 = test[2,5]: est3
estadd scalar rpint3 = test[3,5]: est3

eststo: areg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 p_1mbefore p2016_dm `unbalance_ind' i.s_Soum_ID if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 p_1mbefore p2016_dm `unbalance_ind' i.s_Soum_ID if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4
estadd scalar rpint2 = test[2,5]: est4
estadd scalar rpint3 = test[3,5]: est4


eststo: areg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 i.s4 athome p_1mbefore p2016_dm `unbalance_ind' i.s_Soum_ID if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 p_1mbefore p2016_dm `unbalance_ind' `howexperiment' i.s_Soum_ID if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est5
estadd scalar rpint2 = test[2,5]: est5
estadd scalar rpint3 = test[3,5]: est5




eststo: areg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind' i.s_Soum_ID if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust tmonth_3 tmonth_4 tmonth_5 tmonth_6 tmonth_7 p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind' i.s_Soum_ID if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6
estadd scalar rpint2 = test[2,5]: est6
estadd scalar rpint3 = test[3,5]: est6



esttab  using "final/main_controltmonth.tex", replace scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Female= *female*" "Age= age*" ) 
esttab  using "final/main_controltmonth_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_trust pre_mobile)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/main_controltmonth_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/main_controltmonth_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Female= *female*" "Age= age*" ) 
esttab  using "final/main_controltmonth_foot.tex" , append  scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1  rpint2 rpint3 N ncluster,labels("Rand-t for Disability" "Rand-t for Mobile" "Rand-t for Trust" "Observations" "N of Subdistricts"))




foreach var of varlist pre_disability pre_trust pre_mobile p_1mbefore p2016_dm highereduc3 female age athome highereduc3_mv* visit_all_dm2_mv* female_mv* age_mv* job_mv* {
gen newc_`var' = newcustomer*`var'
}

local newcunbalance_ind "newc_highereduc3_mv* newc_visit_all_dm2_mv*"
local newhowexperiment "newc_highereduc3_mv* newc_visit_all_dm2_mv*"
local newother_ind "newc_female_mv* newc_age_mv* newc_i.job_mv*"

egen newc_s_Soum_ID =  group(newcustomer s_Soum_ID)

				   * extensive vs intensive result 
				   * ========== 
** ”Extensive Margin and Intensive Margin"

eststo clear
eststo est1: areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est1
estadd scalar rpint2 = test[2,5]: est1
estadd scalar rpint3 = test[3,5]: est1


eststo est2: areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0, ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2
estadd scalar rpint2 = test[2,5]: est2
estadd scalar rpint3 = test[3,5]: est2




eststo est3: areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0, ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
estadd scalar rpint2 = test[2,5]: est3
estadd scalar rpint3 = test[3,5]: est3


eststo est4: areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==1 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==1 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4
estadd scalar rpint2 = test[2,5]: est4
estadd scalar rpint3 = test[3,5]: est4

*** add tests with column (1)

areg p_5mafter  newcustomer pre_disability pre_trust pre_mobile  p_1mbefore p2016_dm `unbalance_ind' newc_pre_disability newc_pre_trust newc_pre_mobile newc_p_1mbefore newc_p2016_dm `newcunbalance_ind' i.newcustomer#(i.strata ) if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro cluster(s_Bag_ID) absorb(newc_s_Soum_ID)

testnl  _b[newc_pre_disability] = 0
estadd scalar testwith1_1 =  r(p): est4

testnl _b[newc_pre_trust] = 0
estadd scalar testwith1_2 =  r(p): est4

testnl _b[newc_pre_mobile] = 0
estadd scalar testwith1_3 =  r(p): est4




eststo est5: areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==1, ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==1 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est5
estadd scalar rpint2 = test[2,5]: est5
estadd scalar rpint3 = test[3,5]: est5


areg p_5mafter pre_disability pre_mobile pre_trust athome p_1mbefore p2016_dm `unbalance_ind' `howexperiment' i.s4 i.strata newc_pre_disability newc_pre_mobile newc_pre_trust newc_athome newc_p_1mbefore newc_p2016_dm `newcunbalance_ind' i.newcustomer##i.s4_mv* i.newcustomer##i.athome_mv* i.newcustomer##i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro cluster(s_Bag_ID) absorb(newc_s_Soum_ID)

testnl  _b[newc_pre_disability] = 0
estadd scalar testwith1_1 =  r(p): est5

testnl _b[newc_pre_trust] = 0
estadd scalar testwith1_2 =  r(p): est5

testnl _b[newc_pre_mobile] = 0
estadd scalar testwith1_3 =  r(p): est5



eststo est6: areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==1, ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==1 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6
estadd scalar rpint2 = test[2,5]: est6
estadd scalar rpint3 = test[3,5]: est6

areg p_5mafter pre_disability pre_mobile pre_trust athome p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind' female age i.s4 i.strata i.job  newc_pre_disability newc_pre_mobile newc_pre_trust newc_athome newc_p_1mbefore newc_p2016_dm `newcunbalance_ind' i.newcustomer##i.s4 i.newcustomer##i.athome i.newcustomer##c.age i.newcustomer##i.job i.newcustomer##i.female i.newcustomer##i.strata if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro cluster(s_Bag_ID) absorb(newc_s_Soum_ID)

testnl  _b[newc_pre_disability] = 0
estadd scalar testwith1_1 =  r(p): est6

testnl _b[newc_pre_trust] = 0
estadd scalar testwith1_2 =  r(p): est6

testnl _b[newc_pre_mobile] = 0
estadd scalar testwith1_3 =  r(p): est6



		

esttab  using "final/exin.tex", tex replace scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= *strata" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= _cons" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"  "Female= *female*" "Age= age*" ) 
esttab  using "final/exin_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_trust pre_mobile)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/exin_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/exin_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= *strata" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= _cons" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"  "Female= *female*" "Age= age*" ) 
esttab  using "final/exin_foot.tex" , append   se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1 rpint2 rpint3 testwith1_1 testwith1_2 testwith1_3 N ncluster,labels("Rand-t for Disability" "Rand-t for Mobile" "Rand-t for Trust" "Testing Differences with Column (1), (2), or (3): Disability" "Testing Differences with Column (1), (2), or (3): Mobile" "Testing Differences with Column (1), (2), or (3): Trust" "Observations" "N of Subdistricts"))



 
** Spillover

eststo clear
eststo est1: areg p_5mafter pre_disability pre_mobile pre_trust  i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo est2: areg p_5mafter pre_disability pre_mobile pre_trust pre_*direct i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect) areg p_5mafter pre_disability pre_mobile pre_trust pre_*direct i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2
estadd scalar rpint2 = test[2,5]: est2
estadd scalar rpint3 = test[3,5]: est2

eststo est3: areg p_5mafter pre_disability pre_mobile pre_trust pre_*20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname) areg p_5mafter pre_disability pre_mobile pre_trust pre_*20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
estadd scalar rpint2 = test[2,5]: est3
estadd scalar rpint3 = test[3,5]: est3



eststo est4: areg p_5mafter pre_disability pre_mobile pre_trust pre_*50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd (( pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname) areg p_5mafter pre_disability pre_mobile pre_trust  pre_*50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars( pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4
estadd scalar rpint2 = test[2,5]: est4
estadd scalar rpint3 = test[3,5]: est4


eststo est5: areg p_5mafter pre_disability pre_mobile pre_trust  i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo est6: areg p_5mafter pre_disability pre_mobile pre_trust pre_*direct i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect) areg p_5mafter pre_disability pre_mobile pre_trust pre_*direct i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6
estadd scalar rpint2 = test[2,5]: est6
estadd scalar rpint3 = test[3,5]: est6


eststo est7: areg p_5mafter pre_disability pre_mobile pre_trust pre_*20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  &newcustomer==0  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est7
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname) areg p_5mafter pre_disability pre_mobile pre_trust pre_*20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  &newcustomer==0 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est7
estadd scalar rpint2 = test[2,5]: est7
estadd scalar rpint3 = test[3,5]: est7


eststo est8: areg p_5mafter pre_disability pre_mobile pre_trust pre_*50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  &newcustomer==0  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est8
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd (( pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname) areg p_5mafter pre_disability pre_mobile pre_trust  pre_*50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  &newcustomer==0 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars( pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est8
estadd scalar rpint2 = test[2,5]: est8
estadd scalar rpint3 = test[3,5]: est8


		

* esttab  using "final/exin_spill.tex", replace scalar("rpint1 Rand-t for Disability within 20 km" "rpint2 Rand-t for Mobile within 20 km" "rpint3 Rand-t for Trust within 20 km" "rpint4 Rand-t for Disability within 50 km" "rpint5 Rand-t for Mobile within 50 km" "rpint6 Rand-t for Trust within 50 km" ) se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"   ) 

esttab  using "final/exin_spill_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_mobile pre_trust pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect  pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname) order(pre_disability pre_mobile pre_trust pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect  pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/exin_spill_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/exin_spill_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"   ) 
esttab  using "final/exin_spill_foot.tex" , append  scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1 rpint2 rpint3 N ncluster,labels("Rand-t for Disability Spillover Effects" "Rand-t for Mobile Spillover Effects" "Rand-t for Trust Spillover Effects"  "Observations" "N of Subdistricts"))


** Spillover with pure control

eststo clear



eststo est1: areg p_5mafter pre_mobile pre_trust pre_disability_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability_nei50kmname) areg p_5mafter pre_mobile pre_trust pre_disability_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est1

eststo est2: areg p_5mafter pre_disability pre_trust pre_mobile_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_mobile_nei50kmname) areg p_5mafter pre_trust pre_mobile_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_mobile_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2

eststo est3: areg p_5mafter pre_disability pre_mobile pre_trust_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_trust_nei50kmname) areg p_5mafter pre_trust pre_trust_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_trust_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
        


eststo est4: areg p_5mafter pre_mobile pre_trust pre_disability_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability_nei50kmname) areg p_5mafter pre_mobile pre_trust pre_disability_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4

eststo est5: areg p_5mafter pre_disability pre_trust pre_mobile_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_mobile_nei50kmname) areg p_5mafter pre_trust pre_mobile_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_mobile_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est5

eststo est6: areg p_5mafter pre_disability pre_mobile pre_trust_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_trust_nei50kmname) areg p_5mafter pre_trust pre_trust_nei50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_trust_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6


esttab  using "final/exin_spill_pure.tex", replace scalar("rpint1 Rand-t for Disability within 20 km" "rpint2 Rand-t for Mobile within 20 km" "rpint3 Rand-t for Trust within 20 km" "rpint4 Rand-t for Disability within 50 km" "rpint5 Rand-t for Mobile within 50 km" "rpint6 Rand-t for Trust within 50 km" ) se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"    ) 

esttab  using "final/exin_spill_pure_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_mobile pre_trust pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname ) order(pre_disability pre_mobile pre_trust pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname )  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/exin_spill_pure_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/exin_spill_pure_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"   ) 
esttab  using "final/exin_spill_pure_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1 N ncluster,labels("Rand-t for X in within-50\,km Subdistricts"  "Observations" "N of Subdistricts"))



** Spillover with pure control

eststo clear



eststo est1: areg p_5mafter pre_mobile pre_trust pre_disability_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability_nei20kmname) areg p_5mafter pre_mobile pre_trust pre_disability_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_nei20kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est1

eststo est2: areg p_5mafter pre_disability pre_trust pre_mobile_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_mobile_nei20kmname) areg p_5mafter pre_trust pre_mobile_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_mobile_nei20kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2

eststo est3: areg p_5mafter pre_disability pre_mobile pre_trust_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_trust_nei20kmname) areg p_5mafter pre_trust pre_trust_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_trust_nei20kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
        


eststo est4: areg p_5mafter pre_mobile pre_trust pre_disability_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability_nei20kmname) areg p_5mafter pre_mobile pre_trust pre_disability_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_nei20kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4

eststo est5: areg p_5mafter pre_disability pre_trust pre_mobile_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_mobile_nei20kmname) areg p_5mafter pre_trust pre_mobile_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_mobile_nei20kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est5

eststo est6: areg p_5mafter pre_disability pre_mobile pre_trust_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_trust_nei20kmname) areg p_5mafter pre_trust pre_trust_nei20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_trust_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6


esttab  using "final/exin_spill_pure20.tex", replace scalar("rpint1 Rand-t for Disability within 20 km" "rpint2 Rand-t for Mobile within 20 km" "rpint3 Rand-t for Trust within 20 km" "rpint4 Rand-t for Disability within 50 km" "rpint5 Rand-t for Mobile within 50 km" "rpint6 Rand-t for Trust within 50 km" ) se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"    ) 

esttab  using "final/exin_spill_pure20_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_mobile pre_trust pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname ) order(pre_disability pre_mobile pre_trust pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname )  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/exin_spill_pure20_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/exin_spill_pure20_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"   ) 
esttab  using "final/exin_spill_pure20_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1 N ncluster,labels("Rand-t for X in within-20\,km Subdistricts"  "Observations" "N of Subdistricts"))




** Spillover with pure control

eststo clear



eststo est1: areg p_5mafter pre_mobile pre_trust pre_disability_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability_neidirect) areg p_5mafter pre_mobile pre_trust pre_disability_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_neidirect) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est1

eststo est2: areg p_5mafter pre_disability pre_trust pre_mobile_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_mobile_neidirect) areg p_5mafter pre_trust pre_mobile_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_mobile_neidirect) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2

eststo est3: areg p_5mafter pre_disability pre_mobile pre_trust_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_trust_neidirect) areg p_5mafter pre_trust pre_trust_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_trust_neidirect) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
        


eststo est4: areg p_5mafter pre_mobile pre_trust pre_disability_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability_neidirect) areg p_5mafter pre_mobile pre_trust pre_disability_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_disability == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_neidirect) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4

eststo est5: areg p_5mafter pre_disability pre_trust pre_mobile_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_mobile_neidirect) areg p_5mafter pre_trust pre_mobile_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_mobile == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_mobile_neidirect) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est5

eststo est6: areg p_5mafter pre_disability pre_mobile pre_trust_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_trust_neidirect) areg p_5mafter pre_trust pre_trust_neidirect i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if newcustomer == 0 & pre_trust == 0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_trust_neidirect) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6


esttab  using "final/exin_spill_puredirect.tex", replace scalar("rpint1 Rand-t for Disability within 20 km" "rpint2 Rand-t for Mobile within 20 km" "rpint3 Rand-t for Trust within 20 km" "rpint4 Rand-t for Disability within 50 km" "rpint5 Rand-t for Mobile within 50 km" "rpint6 Rand-t for Trust within 50 km" ) se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"    ) 

esttab  using "final/exin_spill_puredirect_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_mobile pre_trust pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect ) order(pre_disability pre_mobile pre_trust pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect )  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/exin_spill_puredirect_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/exin_spill_puredirect_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"   ) 
esttab  using "final/exin_spill_puredirect_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1 N ncluster,labels("Rand-t for X in Adjacent Subdistricts"  "Observations" "N of Subdistricts"))



** Spillover only using control group

eststo clear

eststo est1: areg p_5mafter pre_*direct i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect) areg p_5mafter pre_*direct i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est1
estadd scalar rpint2 = test[2,5]: est1
estadd scalar rpint3 = test[3,5]: est1

eststo est2: areg p_5mafter pre_*20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname) areg p_5mafter pre_*20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2
estadd scalar rpint2 = test[2,5]: est2
estadd scalar rpint3 = test[3,5]: est2



eststo est3: areg p_5mafter pre_*50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd (( pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname) areg p_5mafter  pre_*50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars( pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
estadd scalar rpint2 = test[2,5]: est3
estadd scalar rpint3 = test[3,5]: est3



eststo est4: areg p_5mafter pre_*direct i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect) areg p_5mafter pre_*direct i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4
estadd scalar rpint2 = test[2,5]: est4
estadd scalar rpint3 = test[3,5]: est4


eststo est5: areg p_5mafter pre_*20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  &newcustomer==0  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname) areg p_5mafter pre_*20kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  &newcustomer==0 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est5
estadd scalar rpint2 = test[2,5]: est5
estadd scalar rpint3 = test[3,5]: est5


eststo est6: areg p_5mafter pre_*50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  &newcustomer==0  ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd (( pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname) areg p_5mafter  pre_*50kmname i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  pre_intervention==5 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7  &newcustomer==0 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars( pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6
estadd scalar rpint2 = test[2,5]: est6
estadd scalar rpint3 = test[3,5]: est6


		

* esttab  using "final/exin_spill.tex", replace scalar("rpint1 Rand-t for Disability within 20 km" "rpint2 Rand-t for Mobile within 20 km" "rpint3 Rand-t for Trust within 20 km" "rpint4 Rand-t for Disability within 50 km" "rpint5 Rand-t for Mobile within 50 km" "rpint6 Rand-t for Trust within 50 km" ) se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"   ) 

esttab  using "final/exin_spillonlycontrol_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect  pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname) order(pre_disability_neidirect pre_mobile_neidirect pre_trust_neidirect  pre_disability_nei20kmname pre_mobile_nei20kmname pre_trust_nei20kmname pre_disability_nei50kmname pre_mobile_nei50kmname pre_trust_nei50kmname)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/exin_spillonlycontrol_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/exin_spillonlycontrol_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"   ) 
esttab  using "final/exin_spillonlycontrol_foot.tex" , append  scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1 rpint2 rpint3 N ncluster,labels("Rand-t for Disability Spillover Effects" "Rand-t for Mobile Spillover Effects" "Rand-t for Trust Spillover Effects"  "Observations" "N of Subdistricts"))




* Spill HH different eststo TBD
* prepare spouse's variables



eststo clear
eststo: areg p_5mafter pre_disability pre_mobile pre_trust   if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est1
estadd scalar rpint2 = test[2,5]: est1
estadd scalar rpint3 = test[3,5]: est1


eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2  if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2
estadd scalar rpint2 = test[2,5]: est2
estadd scalar rpint3 = test[3,5]: est2

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2  i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
estadd scalar rpint2 = test[2,5]: est3
estadd scalar rpint3 = test[3,5]: est3

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 `unbalance_ind' `howexperiment' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 `unbalance_ind' `howexperiment' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4
estadd scalar rpint2 = test[2,5]: est4
estadd scalar rpint3 = test[3,5]: est4


eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 `unbalance_ind' `howexperiment' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 `unbalance_ind' `howexperiment' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est5
estadd scalar rpint2 = test[2,5]: est5
estadd scalar rpint3 = test[3,5]: est5




eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 `unbalance_ind' `howexperiment' `other_ind' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6
estadd scalar rpint2 = test[2,5]: est6
estadd scalar rpint3 = test[3,5]: est6




esttab  using "final/spillHH_head.tex", replace  se   posthead("\hline \\ \multicolumn{@span}{l}{Panel A: Main Outcome (Contribution to the Respondent's Account)  }\\ \hline") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_trust pre_mobile)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/spillHH_foot_mean.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group for Panel A")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/spillHH_foot.tex", replace scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm"  "Contribution to Spouse's Account One Month Before = p_1mbefore_s2"  "Any Contribution to Spouse's Account in 2016 = *p2016_dm_s2" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Female= *female*" "Age= age*" "Occupation Dummies= *job*") 
esttab  using "final/spillHH_foot.tex" , append  scalar("rpint1 Rand-t for Disability in Panel A" "rpint2 Rand-t for Mobile in Panel A" "rpint3 Rand-t for Trust in Panel A") se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(N ncluster rpint1  rpint2 rpint3 ,labels("Observations in Panel A" "N of Subdistricts in Panel A" "Rand-t for Disability in Panel A" "Rand-t for Mobile in Panel A" "Rand-t for Trust in Panel A"))


eststo clear
eststo: areg p_5mafter_s2 pre_disability pre_mobile pre_trust   if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter_s2 pre_disability pre_mobile pre_trust  if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est1
estadd scalar rpint2 = test[2,5]: est1
estadd scalar rpint3 = test[3,5]: est1


eststo: areg p_5mafter_s2 pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2  if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter_s2 pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2
estadd scalar rpint2 = test[2,5]: est2
estadd scalar rpint3 = test[3,5]: est2

eststo: areg p_5mafter_s2 pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter_s2 pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2  i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
estadd scalar rpint2 = test[2,5]: est3
estadd scalar rpint3 = test[3,5]: est3

eststo: areg p_5mafter_s2 pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 `unbalance_ind' `howexperiment' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter_s2 pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 `unbalance_ind' `howexperiment' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4
estadd scalar rpint2 = test[2,5]: est4
estadd scalar rpint3 = test[3,5]: est4


eststo: areg p_5mafter_s2 pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 `unbalance_ind' `howexperiment' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter_s2 pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 `unbalance_ind' `howexperiment' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est5
estadd scalar rpint2 = test[2,5]: est5
estadd scalar rpint3 = test[3,5]: est5




eststo: areg p_5mafter_s2 pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm p_1mbefore_s2 p2016_dm_s2 `unbalance_ind' `howexperiment' `other_ind' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter_s2 pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm `unbalance_ind' `howexperiment' `other_ind' i.s_Soum_ID if  p_1mbefore_s2!=.&	IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6
estadd scalar rpint2 = test[2,5]: est6
estadd scalar rpint3 = test[3,5]: est6



esttab  using "final/spillHH_head.tex", append  se   posthead("\hline \\ \multicolumn{@span}{l}{Panel B: Contribution to the Spouse's Account  }\\ \hline") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_trust pre_mobile)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/spillHH_foot_mean.tex" , append  stats(mean, labels("Mean Outcome in the Control Group for Panel B")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/spillHH_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(N ncluster rpint1  rpint2 rpint3,labels("Observations in Panel B" "N of Subdistricts in Panel B" "Rand-t for Disability in Panel B" "Rand-t for Mobile in Panel B" "Rand-t for Trust in Panel B"))




*** Heterogeneous Impacts

eststo clear



eststo est1: areg p_5mafter         pre_disability pre_disability_visit_all_dm2 pre_mobile pre_mobile_visit_all_dm2 pre_trust pre_trust_visit_all_dm2 visit_all_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_visit_all_dm2 = pre_mobile_visit_all_dm2 = pre_disability_visit_all_dm2
estadd scalar testp = r(p)

 randcmd ((pre_disability pre_mobile pre_trust pre_disability_visit_all_dm2 pre_mobile_visit_all_dm2 pre_trust_visit_all_dm2) areg p_5mafter pre_disability pre_disability_visit_all_dm2 pre_mobile pre_mobile_visit_all_dm2 pre_trust pre_trust_visit_all_dm2 visit_all_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_visit_all_dm2 = pre_disability*visit_all_dm2) calc2(replace pre_mobile_visit_all_dm2 = pre_mobile*visit_all_dm2) calc3(replace pre_trust_visit_all_dm2 = pre_trust*visit_all_dm2) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est1
estadd scalar rpint2 = test[5,5]: est1
estadd scalar rpint3 = test[6,5]: est1

eststo est2: areg p_5mafter         pre_disability pre_disability_visit_all_dm2 pre_mobile pre_mobile_visit_all_dm2 pre_trust pre_trust_visit_all_dm2 visit_all_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment'  pre_*_highereduc3_mv*  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_visit_all_dm2 = pre_mobile_visit_all_dm2 = pre_disability_visit_all_dm2
estadd scalar testp = r(p)
 randcmd ((pre_disability pre_mobile pre_trust pre_disability_visit_all_dm2 pre_mobile_visit_all_dm2 pre_trust_visit_all_dm2) areg p_5mafter pre_disability pre_disability_visit_all_dm2 pre_mobile pre_mobile_visit_all_dm2 pre_trust pre_trust_visit_all_dm2 visit_all_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' pre_*_highereduc3_mv*  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_visit_all_dm2 = pre_disability*visit_all_dm2) calc2(replace pre_mobile_visit_all_dm2 = pre_mobile*visit_all_dm2) calc3(replace pre_trust_visit_all_dm2 = pre_trust*visit_all_dm2) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est2
estadd scalar rpint2 = test[5,5]: est2
estadd scalar rpint3 = test[6,5]: est2



eststo est3: areg p_5mafter         pre_disability pre_disability_cdist_dm2 pre_mobile pre_mobile_cdist_dm2 pre_trust pre_trust_cdist_dm2 cdist_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_cdist_dm2 = pre_mobile_cdist_dm2 = pre_disability_cdist_dm2
estadd scalar testp = r(p)

 randcmd ((pre_disability pre_mobile pre_trust pre_disability_cdist_dm2 pre_mobile_cdist_dm2 pre_trust_cdist_dm2) areg p_5mafter pre_disability pre_disability_cdist_dm2 pre_mobile pre_mobile_cdist_dm2 pre_trust pre_trust_cdist_dm2 cdist_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_cdist_dm2 = pre_disability*cdist_dm2) calc2(replace pre_mobile_cdist_dm2 = pre_mobile*cdist_dm2) calc3(replace pre_trust_cdist_dm2 = pre_trust*cdist_dm2) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est3
estadd scalar rpint2 = test[5,5]: est3
estadd scalar rpint3 = test[6,5]: est3


eststo est4: areg p_5mafter         pre_disability pre_disability_cdist_dm2 pre_mobile pre_mobile_cdist_dm2 pre_trust pre_trust_cdist_dm2 cdist_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment'  pre_*_highereduc3_mv*  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_cdist_dm2 = pre_mobile_cdist_dm2 = pre_disability_cdist_dm2
estadd scalar testp = r(p)

 randcmd ((pre_disability pre_mobile pre_trust pre_disability_cdist_dm2 pre_mobile_cdist_dm2 pre_trust_cdist_dm2) areg p_5mafter pre_disability pre_disability_cdist_dm2 pre_mobile pre_mobile_cdist_dm2 pre_trust pre_trust_cdist_dm2 cdist_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' pre_*_highereduc3_mv*  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_cdist_dm2 = pre_disability*cdist_dm2) calc2(replace pre_mobile_cdist_dm2 = pre_mobile*cdist_dm2) calc3(replace pre_trust_cdist_dm2 = pre_trust*cdist_dm2) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est4
estadd scalar rpint2 = test[5,5]: est4
estadd scalar rpint3 = test[6,5]: est4



eststo est5: areg p_5mafter         pre_disability pre_disability_visit_all_dm2 pre_mobile pre_mobile_visit_all_dm2 pre_trust pre_trust_visit_all_dm2 visit_all_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  newcustomer==0& IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_visit_all_dm2 = pre_mobile_visit_all_dm2 = pre_disability_visit_all_dm2
estadd scalar testp = r(p)
 randcmd ((pre_disability pre_mobile pre_trust pre_disability_visit_all_dm2 pre_mobile_visit_all_dm2 pre_trust_visit_all_dm2) areg p_5mafter pre_disability pre_disability_visit_all_dm2 pre_mobile pre_mobile_visit_all_dm2 pre_trust pre_trust_visit_all_dm2 visit_all_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  newcustomer==0&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_visit_all_dm2 = pre_disability*visit_all_dm2) calc2(replace pre_mobile_visit_all_dm2 = pre_mobile*visit_all_dm2) calc3(replace pre_trust_visit_all_dm2 = pre_trust*visit_all_dm2) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est5
estadd scalar rpint2 = test[5,5]: est5
estadd scalar rpint3 = test[6,5]: est5




eststo est6: areg p_5mafter         pre_disability pre_disability_visit_all_dm2 pre_mobile pre_mobile_visit_all_dm2 pre_trust pre_trust_visit_all_dm2 visit_all_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment'  pre_*_highereduc3_mv* if  newcustomer==0& IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_visit_all_dm2 = pre_mobile_visit_all_dm2 = pre_disability_visit_all_dm2
estadd scalar testp = r(p)

 randcmd ((pre_disability pre_mobile pre_trust pre_disability_visit_all_dm2 pre_mobile_visit_all_dm2 pre_trust_visit_all_dm2) areg p_5mafter pre_disability pre_disability_visit_all_dm2 pre_mobile pre_mobile_visit_all_dm2 pre_trust pre_trust_visit_all_dm2 visit_all_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' pre_*_incomegroup_* if  newcustomer==0&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_visit_all_dm2 = pre_disability*visit_all_dm2) calc2(replace pre_mobile_visit_all_dm2 = pre_mobile*visit_all_dm2) calc3(replace pre_trust_visit_all_dm2 = pre_trust*visit_all_dm2) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est6
estadd scalar rpint2 = test[5,5]: est6
estadd scalar rpint3 = test[6,5]: est6


eststo est7: areg p_5mafter         pre_disability pre_disability_cdist_dm2 pre_mobile pre_mobile_cdist_dm2 pre_trust pre_trust_cdist_dm2 cdist_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  newcustomer==0& IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est7
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_cdist_dm2 = pre_mobile_cdist_dm2 = pre_disability_cdist_dm2
estadd scalar testp = r(p)

 randcmd ((pre_disability pre_mobile pre_trust pre_disability_cdist_dm2 pre_mobile_cdist_dm2 pre_trust_cdist_dm2) areg p_5mafter pre_disability pre_disability_cdist_dm2 pre_mobile pre_mobile_cdist_dm2 pre_trust pre_trust_cdist_dm2 cdist_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  newcustomer==0&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_cdist_dm2 = pre_disability*cdist_dm2) calc2(replace pre_mobile_cdist_dm2 = pre_mobile*cdist_dm2) calc3(replace pre_trust_cdist_dm2 = pre_trust*cdist_dm2) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est7
estadd scalar rpint2 = test[5,5]: est7
estadd scalar rpint3 = test[6,5]: est7


eststo est8: areg p_5mafter         pre_disability pre_disability_cdist_dm2 pre_mobile pre_mobile_cdist_dm2 pre_trust pre_trust_cdist_dm2 cdist_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment'  pre_*_highereduc3_mv* if  newcustomer==0& IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est8
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_cdist_dm2 = pre_mobile_cdist_dm2 = pre_disability_cdist_dm2
estadd scalar testp = r(p)

 randcmd ((pre_disability pre_mobile pre_trust pre_disability_cdist_dm2 pre_mobile_cdist_dm2 pre_trust_cdist_dm2) areg p_5mafter pre_disability pre_disability_cdist_dm2 pre_mobile pre_mobile_cdist_dm2 pre_trust pre_trust_cdist_dm2 cdist_dm2 i.strata p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' pre_*_incomegroup_* if  newcustomer==0&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_cdist_dm2 = pre_disability*cdist_dm2) calc2(replace pre_mobile_cdist_dm2 = pre_mobile*cdist_dm2) calc3(replace pre_trust_cdist_dm2 = pre_trust*cdist_dm2) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est8
estadd scalar rpint2 = test[5,5]: est8
estadd scalar rpint3 = test[6,5]: est8






* esttab  using "final/interaction_mobile.tex", replace scalar("rpint1 Rand-t for X_i*Disability" "rpint2 Rand-t for X_i*Mobile" "rpint3 Rand-t for X_i*Trust")  se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"  ) 

esttab  using "final/interaction_mobile_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability* pre_trust* pre_mobile*) drop(*highereduc3*) stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label order(pre_disability pre_mobile pre_trust pre_disability_visit_all_dm2  pre_mobile_visit_all_dm2  pre_trust_visit_all_dm2 pre_trust pre_disability_cdist_dm2  pre_mobile_cdist_dm2  pre_trust_cdist_dm2 )
esttab  using "final/interaction_mobile_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/interaction_mobile_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Remoteness (Frequency) = visit_all_dm2*" "Remoteness (Distance) = cdist_dm2*"  "Higher Education * Treatment Dummies = pre*highereduc3_mv*") 
esttab  using "final/interaction_mobile_foot.tex" , append   se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1  rpint2 rpint3 testp N ncluster,labels("Rand-t for X_i*Disability" "Rand-t for X_i*Mobile"  "Rand-t for X_i*Trust" "Testing X_i*Disability == X_i*Mobile == X_i*Trust" "Observations" "N of Subdistricts"))




eststo clear




eststo est1: areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_tr_dm = pre_mobile_ja_tr_dm = pre_disability_ja_tr_dm
estadd scalar testp = r(p)

randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_tr_dm pre_mobile_ja_tr_dm pre_trust_ja_tr_dm) areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_tr_dm = pre_disability*ja_tr_dm) calc2(replace pre_mobile_ja_tr_dm = pre_mobile*ja_tr_dm) calc3(replace pre_trust_ja_tr_dm = pre_trust*ja_tr_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est1
estadd scalar rpint2 = test[5,5]: est1
estadd scalar rpint3 = test[6,5]: est1


eststo est2: areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_fr_dm = pre_mobile_ja_fr_dm = pre_disability_ja_fr_dm
estadd scalar testp = r(p)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm) areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_fr_dm = pre_disability*ja_fr_dm) calc2(replace pre_mobile_ja_fr_dm = pre_mobile*ja_fr_dm) calc3(replace pre_trust_ja_fr_dm = pre_trust*ja_fr_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est2
estadd scalar rpint2 = test[5,5]: est2
estadd scalar rpint3 = test[6,5]: est2

eststo est3: areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_tr_dm = pre_mobile_ja_tr_dm = pre_disability_ja_tr_dm
estadd scalar testp = r(p)
test pre_trust_pen_expect_dm = pre_mobile_pen_expect_dm = pre_disability_pen_expect_dm
estadd scalar testp2 = r(p)

randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_tr_dm pre_mobile_ja_tr_dm pre_trust_ja_tr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm) areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_tr_dm = pre_disability*ja_tr_dm) calc2(replace pre_mobile_ja_tr_dm = pre_mobile*ja_tr_dm) calc3(replace pre_trust_ja_tr_dm = pre_trust*ja_tr_dm) calc4(replace pre_disability_pen_expect_dm = pre_disability*pen_expect_dm) calc5(replace pre_mobile_pen_expect_dm = pre_mobile*pen_expect_dm) calc6(replace pre_trust_pen_expect_dm = pre_trust*pen_expect_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est3
estadd scalar rpint2 = test[5,5]: est3
estadd scalar rpint3 = test[6,5]: est3
estadd scalar rpint4 = test[7,5]: est3
estadd scalar rpint5 = test[8,5]: est3
estadd scalar rpint6 = test[9,5]: est3


eststo est4: areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_fr_dm = pre_mobile_ja_fr_dm = pre_disability_ja_fr_dm
estadd scalar testp = r(p)
test pre_trust_pen_expect_dm = pre_mobile_pen_expect_dm = pre_disability_pen_expect_dm
estadd scalar testp2 = r(p)

randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm) areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_fr_dm = pre_disability*ja_fr_dm) calc2(replace pre_mobile_ja_fr_dm = pre_mobile*ja_fr_dm) calc3(replace pre_trust_ja_fr_dm = pre_trust*ja_fr_dm) calc4(replace pre_disability_pen_expect_dm = pre_disability*pen_expect_dm) calc5(replace pre_mobile_pen_expect_dm = pre_mobile*pen_expect_dm) calc6(replace pre_trust_pen_expect_dm = pre_trust*pen_expect_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est4
estadd scalar rpint2 = test[5,5]: est4
estadd scalar rpint3 = test[6,5]: est4
estadd scalar rpint4 = test[7,5]: est4
estadd scalar rpint5 = test[8,5]: est4
estadd scalar rpint6 = test[9,5]: est4

* eststo est4: areg p_5mafter pre_disability pre_disability_`unbalance_ind' `howexperiment' pre_mobile pre_mobile_`unbalance_ind' `howexperiment' pre_trust pre_trust_`unbalance_ind' `howexperiment' `unbalance_ind' `howexperiment' i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
* estadd scalar ncluster = e(N_clust): est4
* sum `e(depvar)' if e(sample) & pre_intervention == 5
* estadd scalar mean= r(mean)

* test pre_trust_`unbalance_ind' `howexperiment' = pre_mobile_`unbalance_ind' `howexperiment' = pre_disability_`unbalance_ind' `howexperiment'
* estadd scalar testp = r(p)
 * randcmd ((pre_disability pre_mobile pre_trust pre_disability_`unbalance_ind' `howexperiment' pre_mobile_`unbalance_ind' `howexperiment' pre_trust_`unbalance_ind' `howexperiment') areg p_5mafter pre_disability pre_disability_`unbalance_ind' `howexperiment' pre_mobile pre_mobile_`unbalance_ind' `howexperiment' pre_trust pre_trust_`unbalance_ind' `howexperiment' `unbalance_ind' `howexperiment' i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_`unbalance_ind' `howexperiment' = pre_disability*`unbalance_ind' `howexperiment') calc2(replace pre_mobile_`unbalance_ind' `howexperiment' = pre_mobile*`unbalance_ind' `howexperiment') calc3(replace pre_trust_`unbalance_ind' `howexperiment' = pre_trust*`unbalance_ind' `howexperiment') groupvar(s_Bag_ID) strata(strata)
* matrix test = e(RCoef)  
* estadd scalar rpint1 = test[4,5]: est4
* estadd scalar rpint2 = test[5,5]: est4
* estadd scalar rpint3 = test[6,5]: est4

eststo est5: areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_tr_dm = pre_mobile_ja_tr_dm = pre_disability_ja_tr_dm
estadd scalar testp = r(p)

randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_tr_dm pre_mobile_ja_tr_dm pre_trust_ja_tr_dm) areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_tr_dm = pre_disability*ja_tr_dm) calc2(replace pre_mobile_ja_tr_dm = pre_mobile*ja_tr_dm) calc3(replace pre_trust_ja_tr_dm = pre_trust*ja_tr_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est5
estadd scalar rpint2 = test[5,5]: est5
estadd scalar rpint3 = test[6,5]: est5

eststo est6: areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 &IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_fr_dm = pre_mobile_ja_fr_dm = pre_disability_ja_fr_dm
estadd scalar testp = r(p)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm) areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0  & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_fr_dm = pre_disability*ja_fr_dm) calc2(replace pre_mobile_ja_fr_dm = pre_mobile*ja_fr_dm) calc3(replace pre_trust_ja_fr_dm = pre_trust*ja_fr_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est6
estadd scalar rpint2 = test[5,5]: est6
estadd scalar rpint3 = test[6,5]: est6


eststo est7: areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est7
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_tr_dm = pre_mobile_ja_tr_dm = pre_disability_ja_tr_dm
estadd scalar testp = r(p)
test pre_trust_pen_expect_dm = pre_mobile_pen_expect_dm = pre_disability_pen_expect_dm
estadd scalar testp2 = r(p)

randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_tr_dm pre_mobile_ja_tr_dm pre_trust_ja_tr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm) areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_tr_dm = pre_disability*ja_tr_dm) calc2(replace pre_mobile_ja_tr_dm = pre_mobile*ja_tr_dm) calc3(replace pre_trust_ja_tr_dm = pre_trust*ja_tr_dm) calc4(replace pre_disability_pen_expect_dm = pre_disability*pen_expect_dm) calc5(replace pre_mobile_pen_expect_dm = pre_mobile*pen_expect_dm) calc6(replace pre_trust_pen_expect_dm = pre_trust*pen_expect_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est7
estadd scalar rpint2 = test[5,5]: est7
estadd scalar rpint3 = test[6,5]: est7
estadd scalar rpint4 = test[7,5]: est7
estadd scalar rpint5 = test[8,5]: est7
estadd scalar rpint6 = test[9,5]: est7


eststo est8: areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est8
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_fr_dm = pre_mobile_ja_fr_dm = pre_disability_ja_fr_dm
estadd scalar testp = r(p)
test pre_trust_pen_expect_dm = pre_mobile_pen_expect_dm = pre_disability_pen_expect_dm
estadd scalar testp2 = r(p)

randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm) areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_fr_dm = pre_disability*ja_fr_dm) calc2(replace pre_mobile_ja_fr_dm = pre_mobile*ja_fr_dm) calc3(replace pre_trust_ja_fr_dm = pre_trust*ja_fr_dm) calc4(replace pre_disability_pen_expect_dm = pre_disability*pen_expect_dm) calc5(replace pre_mobile_pen_expect_dm = pre_mobile*pen_expect_dm) calc6(replace pre_trust_pen_expect_dm = pre_trust*pen_expect_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est8
estadd scalar rpint2 = test[5,5]: est8
estadd scalar rpint3 = test[6,5]: est8
estadd scalar rpint4 = test[7,5]: est8
estadd scalar rpint5 = test[8,5]: est8
estadd scalar rpint6 = test[9,5]: est8




esttab  using "final/interaction_trust.tex", replace scalar("rpint1 Rand-t for X_i*Disability" "rpint2 Rand-t for X_i*Mobile" "rpint3 Rand-t for X_i*Trust")  se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" ) 

esttab  using "final/interaction_trust_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability* pre_trust* pre_mobile*)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label order(pre_disability pre_mobile pre_trust)
esttab  using "final/interaction_trust_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/interaction_trust_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Japan Trust Dummy = ja_tr_dm" "Japan Friendship Dummy = ja_fr_dm") 
esttab  using "final/interaction_trust_foot.tex" , append  scalar("rpint1 Rand-t for X_i*Disability" "rpint2 Rand-t for X_i*Mobile" "rpint3 Rand-t for X_i*Trust" "rpint4 Rand-t for Pension Expect Dummy*Trust" "rpint5 Rand-t for Pension Expect Dummy*Trust" "rpint6 Rand-t for Pension Expect Dummy*Trust" ) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1 rpint2 rpint3 rpint4 rpint5 rpint6 testp testp2 N ncluster,labels("Rand-t for X_i*Disability" "Rand-t for X_i*Mobile" "Rand-t for X_i*Trust" "Rand-t for PED*Disability" "Rand-t for PED*Mobile" "Rand-t for PED*Trust" "Testing X_i*Disability == X_i*Mobile == X_i*Trust" "Testing PED*Disability == PED*Mobile == PED*Trust" "Observations" "N of Subdistricts"))


eststo clear




eststo est1: areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_tr_dm = pre_mobile_ja_tr_dm = pre_disability_ja_tr_dm
estadd scalar testp = r(p)

randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_tr_dm pre_mobile_ja_tr_dm pre_trust_ja_tr_dm) areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_tr_dm = pre_disability*ja_tr_dm) calc2(replace pre_mobile_ja_tr_dm = pre_mobile*ja_tr_dm) calc3(replace pre_trust_ja_tr_dm = pre_trust*ja_tr_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est1
estadd scalar rpint2 = test[5,5]: est1
estadd scalar rpint3 = test[6,5]: est1


eststo est2: areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_fr_dm = pre_mobile_ja_fr_dm = pre_disability_ja_fr_dm
estadd scalar testp2 = r(p)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm) areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_fr_dm = pre_disability*ja_fr_dm) calc2(replace pre_mobile_ja_fr_dm = pre_mobile*ja_fr_dm) calc3(replace pre_trust_ja_fr_dm = pre_trust*ja_fr_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint4 = test[4,5]: est2
estadd scalar rpint5 = test[5,5]: est2
estadd scalar rpint6 = test[6,5]: est2

eststo est3: areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


test pre_trust_pen_expect_dm = pre_mobile_pen_expect_dm = pre_disability_pen_expect_dm
estadd scalar testp3 = r(p)

randcmd ((pre_disability pre_mobile pre_trust  pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm) areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_pen_expect_dm = pre_disability*pen_expect_dm) calc2(replace pre_mobile_pen_expect_dm = pre_mobile*pen_expect_dm) calc3(replace pre_trust_pen_expect_dm = pre_trust*pen_expect_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint7 = test[4,5]: est3
estadd scalar rpint8 = test[5,5]: est3
estadd scalar rpint9 = test[6,5]: est3


eststo est4: areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_tr_dm = pre_mobile_ja_tr_dm = pre_disability_ja_tr_dm
estadd scalar testp = r(p)
test pre_trust_ja_fr_dm = pre_mobile_ja_fr_dm = pre_disability_ja_fr_dm
estadd scalar testp2 = r(p)
test pre_trust_pen_expect_dm = pre_mobile_pen_expect_dm = pre_disability_pen_expect_dm
estadd scalar testp3 = r(p)

randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_tr_dm pre_mobile_ja_tr_dm pre_trust_ja_tr_dm pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm) areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm  `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_tr_dm = pre_disability*ja_tr_dm) calc2(replace pre_mobile_ja_tr_dm = pre_mobile*ja_tr_dm) calc3(replace pre_trust_ja_tr_dm = pre_trust*ja_tr_dm) calc4(replace pre_disability_ja_fr_dm = pre_disability*ja_fr_dm) calc5(replace pre_mobile_ja_fr_dm = pre_mobile*ja_fr_dm) calc6(replace pre_trust_ja_fr_dm = pre_trust*ja_fr_dm) calc7(replace pre_disability_pen_expect_dm = pre_disability*pen_expect_dm) calc8(replace pre_mobile_pen_expect_dm = pre_mobile*pen_expect_dm) calc9(replace pre_trust_pen_expect_dm = pre_trust*pen_expect_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est4
estadd scalar rpint2 = test[5,5]: est4
estadd scalar rpint3 = test[6,5]: est4
estadd scalar rpint4 = test[7,5]: est4
estadd scalar rpint5 = test[8,5]: est4
estadd scalar rpint6 = test[9,5]: est4
estadd scalar rpint7 = test[10,5]: est4
estadd scalar rpint8 = test[11,5]: est4
estadd scalar rpint9 = test[12,5]: est4



eststo est5: areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_tr_dm = pre_mobile_ja_tr_dm = pre_disability_ja_tr_dm
estadd scalar testp = r(p)

randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_tr_dm pre_mobile_ja_tr_dm pre_trust_ja_tr_dm) areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_tr_dm = pre_disability*ja_tr_dm) calc2(replace pre_mobile_ja_tr_dm = pre_mobile*ja_tr_dm) calc3(replace pre_trust_ja_tr_dm = pre_trust*ja_tr_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est5
estadd scalar rpint2 = test[5,5]: est5
estadd scalar rpint3 = test[6,5]: est5


eststo est6: areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_fr_dm = pre_mobile_ja_fr_dm = pre_disability_ja_fr_dm
estadd scalar testp2 = r(p)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm) areg p_5mafter pre_disability pre_disability_ja_fr_dm pre_mobile pre_mobile_ja_fr_dm pre_trust pre_trust_ja_fr_dm ja_fr_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_fr_dm = pre_disability*ja_fr_dm) calc2(replace pre_mobile_ja_fr_dm = pre_mobile*ja_fr_dm) calc3(replace pre_trust_ja_fr_dm = pre_trust*ja_fr_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint4 = test[4,5]: est6
estadd scalar rpint5 = test[5,5]: est6
estadd scalar rpint6 = test[6,5]: est6

eststo est7: areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est7
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


test pre_trust_pen_expect_dm = pre_mobile_pen_expect_dm = pre_disability_pen_expect_dm
estadd scalar testp3 = r(p)

randcmd ((pre_disability pre_mobile pre_trust  pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm) areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_pen_expect_dm = pre_disability*pen_expect_dm) calc2(replace pre_mobile_pen_expect_dm = pre_mobile*pen_expect_dm) calc3(replace pre_trust_pen_expect_dm = pre_trust*pen_expect_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint7 = test[4,5]: est7
estadd scalar rpint8 = test[5,5]: est7
estadd scalar rpint9 = test[6,5]: est7


eststo est8: areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est8
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

test pre_trust_ja_tr_dm = pre_mobile_ja_tr_dm = pre_disability_ja_tr_dm
estadd scalar testp = r(p)
test pre_trust_ja_fr_dm = pre_mobile_ja_fr_dm = pre_disability_ja_fr_dm
estadd scalar testp2 = r(p)
test pre_trust_pen_expect_dm = pre_mobile_pen_expect_dm = pre_disability_pen_expect_dm
estadd scalar testp3 = r(p)

randcmd ((pre_disability pre_mobile pre_trust pre_disability_ja_tr_dm pre_mobile_ja_tr_dm pre_trust_ja_tr_dm pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm) areg p_5mafter pre_disability pre_disability_ja_tr_dm pre_mobile pre_mobile_ja_tr_dm pre_trust pre_trust_ja_tr_dm ja_tr_dm pre_disability_ja_fr_dm pre_mobile_ja_fr_dm pre_trust_ja_fr_dm ja_fr_dm pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm pen_expect_dm i.s_Soum_ID p_1mbefore p2016_dm  `unbalance_ind' `howexperiment' if  newcustomer==0 & IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_ja_fr_dm = pre_disability*ja_fr_dm) calc2(replace pre_mobile_ja_fr_dm = pre_mobile*ja_fr_dm) calc3(replace pre_trust_ja_fr_dm = pre_trust*ja_fr_dm) calc4(replace pre_disability_pen_expect_dm = pre_disability*pen_expect_dm) calc5(replace pre_mobile_pen_expect_dm = pre_mobile*pen_expect_dm) calc6(replace pre_trust_pen_expect_dm = pre_trust*pen_expect_dm) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est8
estadd scalar rpint2 = test[5,5]: est8
estadd scalar rpint3 = test[6,5]: est8
estadd scalar rpint4 = test[7,5]: est8
estadd scalar rpint5 = test[8,5]: est8
estadd scalar rpint6 = test[9,5]: est8
estadd scalar rpint7 = test[10,5]: est8
estadd scalar rpint8 = test[11,5]: est8
estadd scalar rpint9 = test[12,5]: est8




esttab  using "final/interaction_trustalt.tex", replace scalar("rpint1 Rand-t for X_i*Disability" "rpint2 Rand-t for X_i*Mobile" "rpint3 Rand-t for X_i*Trust")  se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" ) 

esttab  using "final/interaction_trustalt_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability* pre_trust* pre_mobile*)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label order(pre_disability pre_mobile pre_trust)
esttab  using "final/interaction_trustalt_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/interaction_trustalt_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Japan Trust Dummy = ja_tr_dm" "Japan Friendship Dummy = ja_fr_dm" "Pension Expect Dummy = pen_expect_dm") 
esttab  using "final/interaction_trustalt_foot.tex" , append  scalar("rpint1 Rand-t for Japan Trust Dummy*Disability" "rpint2 Rand-t for Japan Trust Dummy*Mobile" "rpint3 Rand-t for Japan Trust Dummy*Trust" "rpint4 Rand-t for Japan Friendship Dummy*Trust" "rpint5 Rand-t for Japan Friendship Dummy*Trust" "rpint6 Rand-t for Japan Friendship Dummy*Trust" "rpint7 Rand-t for Pension Expect Dummy*Trust" "rpint8 Rand-t for Pension Expect Dummy*Trust" "rpint9 Rand-t for Pension Expect Dummy*Trust" ) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1 rpint2 rpint3 rpint4 rpint5 rpint6 rpint7 rpint8 rpint9 testp testp2 testp3 N ncluster,labels("Rand-t for Japan Trust Dummy*Disability" "Rand-t for Japan Trust Dummy*Mobile" "Rand-t for Japan Trust Dummy*Trust" "Rand-t for Japan Friendship Dummy*Disability" "Rand-t for Japan Friendship Dummy*Mobile" "Rand-t for Japan Friendship Dummy*Trust" "Rand-t for PED*Disability" "Rand-t for PED*Mobile" "Rand-t for PED*Trust" "Testing All Interactions are the Same (Japan Trust)"  "Testing All Interactions are the Same (Japan Friendship)"   "Testing All Interactions are the Same (PED)" "Observations" "N of Subdistricts"))




eststo clear
eststo: areg p_5mafter pre_disability pre_mobile pre_trust  pre_*athome athome if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm pre_*athome athome if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata)  cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID pre_*athome athome if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID pre_*athome athome `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID pre_*athome athome `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID pre_*athome athome `unbalance_ind' `howexperiment' `other_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)



esttab  using "final/main_noathome.tex", replace scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Female= *female*" "Age= age*" ) 
esttab  using "final/main_noathome_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability* pre_trust* pre_mobile*)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/main_noathome_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/main_noathome_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Female= *female*" "Age= age*" ) 
esttab  using "final/main_noathome_foot.tex" , append  scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(N ncluster,labels("Observations" "N of Subdistricts"))


eststo clear
eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' `other_ind' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' `other_ind' if  athome==0&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' `other_ind' if  newcustomer==0&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' `other_ind' if  athome==0& newcustomer==0&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' `other_ind' if  newcustomer==1&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' `other_ind' if  athome==0& newcustomer==1&IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


esttab  using "final/main_noathomeexclude.tex", replace scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Female= *female*" "Age= age*" ) 
esttab  using "final/main_noathomeexclude_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability* pre_trust* pre_mobile*)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/main_noathomeexclude_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/main_noathomeexclude_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Female= *female*" "Age= age*" ) 
esttab  using "final/main_noathomeexclude_foot.tex" , append  scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(N ncluster,labels("Observations" "N of Subdistricts"))




* External Validity: Heterogeneity in the Attendance to the Subdistrict Meeting
eststo clear


eststo:areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_sd_mattend pre_mobile_sd_mattend pre_trust_sd_mattend sd_mattend i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'   if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_sd_mattend pre_mobile_sd_mattend pre_trust_sd_mattend) areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_sd_mattend pre_mobile_sd_mattend pre_trust_sd_mattend sd_mattend i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_sd_mattend = pre_disability*sd_mattend) calc2(replace pre_mobile_sd_mattend = pre_mobile*sd_mattend) calc3(replace pre_trust_sd_mattend = pre_trust*sd_mattend) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est1
estadd scalar rpint2 = test[5,5]: est1
estadd scalar rpint3 = test[6,5]: est1


eststo:areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_sd_mattend pre_mobile_sd_mattend pre_trust_sd_mattend sd_mattend i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'   if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_sd_mattend pre_mobile_sd_mattend pre_trust_sd_mattend) areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_sd_mattend pre_mobile_sd_mattend pre_trust_sd_mattend sd_mattend i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 & newcustomer == 0,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_sd_mattend = pre_disability*sd_mattend) calc2(replace pre_mobile_sd_mattend = pre_mobile*sd_mattend) calc3(replace pre_trust_sd_mattend = pre_trust*sd_mattend) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est2
estadd scalar rpint2 = test[5,5]: est2
estadd scalar rpint3 = test[6,5]: est2


eststo:areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_athome pre_mobile_athome pre_trust_athome athome i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'   if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_athome pre_mobile_athome pre_trust_athome) areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_athome pre_mobile_athome pre_trust_athome athome i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_athome = pre_disability*athome) calc2(replace pre_mobile_athome = pre_mobile*athome) calc3(replace pre_trust_athome = pre_trust*athome) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est3
estadd scalar rpint2 = test[5,5]: est3
estadd scalar rpint3 = test[6,5]: est3


eststo:areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_athome pre_mobile_athome pre_trust_athome athome i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'   if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_athome pre_mobile_athome pre_trust_athome) areg p_5mafter pre_disability pre_mobile pre_trust pre_disability_athome pre_mobile_athome pre_trust_athome athome i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 & newcustomer == 0,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_athome = pre_disability*athome) calc2(replace pre_mobile_athome = pre_mobile*athome) calc3(replace pre_trust_athome = pre_trust*athome) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est4
estadd scalar rpint2 = test[5,5]: est4
estadd scalar rpint3 = test[6,5]: est4

esttab  using "final/externalvalidity.tex", replace scalar("rpint1 Rand-t for Disability * Attendance in 2016" "rpint2 Rand-t for Mobile * Attendance in 2016" "rpint3 Rand-t for Trust * Attendance in 2016" "rpint4 Rand-t for Traeted * Attendance in 2016")  se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= *strata" "District Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"  "Attendance in 2016 = sd_mattend"  )

esttab  using "final/externalvalidity_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability*  pre_mobile* pre_trust*) order(pre_disability pre_mobile pre_trust)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/externalvalidity_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/externalvalidity_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= *strata"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm"  "District Fixed Effects= _cons" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Attendance in 2016 = sd_mattend") 
esttab  using "final/externalvalidity_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1 rpint2 rpint3 N ncluster,labels("Rand-t for Disability * X" "Rand-t for Mobile * X" "Rand-t for Trust * X" "Observations" "N of Subdistricts"))


*  External Validity When Controlling for Trust to Pension System
eststo clear


eststo:areg p_5mafter pre_disability pre_disability_sd_mattend pre_mobile pre_mobile_sd_mattend pre_trust pre_trust_sd_mattend sd_mattend  pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'   if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_sd_mattend pre_mobile_sd_mattend pre_trust_sd_mattend) areg p_5mafter pre_disability pre_disability_sd_mattend pre_mobile pre_mobile_sd_mattend pre_trust pre_trust_sd_mattend sd_mattend  pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_sd_mattend = pre_disability*sd_mattend) calc2(replace pre_mobile_sd_mattend = pre_mobile*sd_mattend) calc3(replace pre_trust_sd_mattend = pre_trust*sd_mattend) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est1
estadd scalar rpint2 = test[5,5]: est1
estadd scalar rpint3 = test[6,5]: est1


eststo:areg p_5mafter pre_disability pre_disability_sd_mattend pre_mobile pre_mobile_sd_mattend pre_trust pre_trust_sd_mattend sd_mattend  pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'   if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_sd_mattend pre_mobile_sd_mattend pre_trust_sd_mattend) areg p_5mafter pre_disability pre_disability_sd_mattend pre_mobile pre_mobile_sd_mattend pre_trust pre_trust_sd_mattend sd_mattend  pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 & newcustomer == 0,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_sd_mattend = pre_disability*sd_mattend) calc2(replace pre_mobile_sd_mattend = pre_mobile*sd_mattend) calc3(replace pre_trust_sd_mattend = pre_trust*sd_mattend) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est2
estadd scalar rpint2 = test[5,5]: est2
estadd scalar rpint3 = test[6,5]: est2


eststo:areg p_5mafter pre_disability pre_disability_athome pre_mobile pre_mobile_athome pre_trust pre_trust_athome athome pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'   if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_athome pre_mobile_athome pre_trust_athome) areg p_5mafter pre_disability pre_disability_athome pre_mobile pre_mobile_athome pre_trust pre_trust_athome athome pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_athome = pre_disability*athome) calc2(replace pre_mobile_athome = pre_mobile*athome) calc3(replace pre_trust_athome = pre_trust*athome) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est3
estadd scalar rpint2 = test[5,5]: est3
estadd scalar rpint3 = test[6,5]: est3


eststo:areg p_5mafter pre_disability pre_disability_athome pre_mobile pre_mobile_athome pre_trust pre_trust_athome athome pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'   if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 &newcustomer==0,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust pre_disability_athome pre_mobile_athome pre_trust_athome) areg p_5mafter pre_disability pre_disability_athome pre_mobile pre_mobile_athome pre_trust pre_trust_athome athome pre_disability_pen_expect_dm pre_mobile_pen_expect_dm pre_trust_pen_expect_dm i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment'  if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 & newcustomer == 0,  ro absorb(s_Soum_ID) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) calc1(replace pre_disability_athome = pre_disability*athome) calc2(replace pre_mobile_athome = pre_mobile*athome) calc3(replace pre_trust_athome = pre_trust*athome) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[4,5]: est4
estadd scalar rpint2 = test[5,5]: est4
estadd scalar rpint3 = test[6,5]: est4



esttab  using "final/externalvalidity_trustcontrol.tex", replace scalar("rpint1 Rand-t for Disability * Attendance in 2016" "rpint2 Rand-t for Mobile * Attendance in 2016" "rpint3 Rand-t for Trust * Attendance in 2016" "rpint4 Rand-t for Traeted * Attendance in 2016")  se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= *strata" "District Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" )

esttab  using "final/externalvalidity_trustcontrol_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability*  pre_mobile* pre_trust*) order(pre_disability pre_mobile pre_trust) drop(*pen_expect_dm)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/externalvalidity_trustcontrol_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/externalvalidity_trustcontrol_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= *strata"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm"  "District Fixed Effects= _cons" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Attendance in 2016 = sd_mattend" "Pension Expect Dummy (* Treatment Dummies) = *pen_expect_dm" ) 
esttab  using "final/externalvalidity_trustcontrol_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1 rpint2 rpint3 N ncluster,labels("Rand-t for Disability * X" "Rand-t for Mobile * X" "Rand-t for Trust * X"  "Observations" "N of Subdistricts"))


* "Adverse Selection"

eststo clear

eststo est1: areg p_1mbefore 		life_expect_ng   i.strata `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est2: areg p_5mafter 		 pre_disability_life_expect_ng  pre_mobile_life_expect_ng  pre_trust_life_expect_ng life_expect_ng pre_disability pre_mobile pre_trust i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo est3: areg p_1mbefore 		sd_healthshock   i.strata `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est4: areg p_5mafter 		 pre_disability_sd_healthshock  pre_mobile_sd_healthshock  pre_trust_sd_healthshock sd_healthshock pre_disability pre_mobile pre_trust i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est5: areg p_1mbefore 		sd_unhealthy   i.strata `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est6: areg p_5mafter 		 pre_disability_sd_unhealthy  pre_mobile_sd_unhealthy  pre_trust_sd_unhealthy sd_unhealthy pre_disability pre_mobile pre_trust i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


esttab  using "final/adverse_interaction.tex", replace   se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= *strata" "District Fixed Effects= _cons"  "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"    ) 


esttab  using "final/adverse_interaction_head.tex", replace  se order(pre_disability pre_mobile pre_trust )  posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability* pre_trust* pre_mobile* life_expect_ng sd_healthshock sd_unhealthy)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/adverse_interaction_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/adverse_interaction_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= *strata"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm"  "District Fixed Effects= _cons" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"   ) 
esttab  using "final/adverse_interaction_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(N ncluster,labels("Observations" "N of Subdistricts"))

areg p_5mafter 		 pre_disability_sd_accident  pre_mobile_sd_accident  pre_trust_sd_accident sd_accident pre_disability pre_mobile pre_trust i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)

eststo clear

eststo est1: areg p_1mbefore        life_expect_ng   i.strata highereduc3 pre_disability_visit_all_dm2 pre_mobile_visit_all_dm2 pre_trust_visit_all_dm2 visit_all_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est2: areg p_5mafter          pre_disability_life_expect_ng  pre_mobile_life_expect_ng  pre_trust_life_expect_ng life_expect_ng pre_disability pre_mobile pre_trust i.strata p_1mbefore p2016_dm highereduc3 pre_disability_visit_all_dm2 pre_mobile_visit_all_dm2 pre_trust_visit_all_dm2 visit_all_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo est3: areg p_1mbefore        sd_healthshock   i.strata highereduc3 pre_disability_visit_all_dm2 pre_mobile_visit_all_dm2 pre_trust_visit_all_dm2 visit_all_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est4: areg p_5mafter          pre_disability_sd_healthshock  pre_mobile_sd_healthshock  pre_trust_sd_healthshock sd_healthshock pre_disability pre_mobile pre_trust i.strata p_1mbefore p2016_dm highereduc3 pre_disability_visit_all_dm2 pre_mobile_visit_all_dm2 pre_trust_visit_all_dm2 visit_all_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est5: areg p_1mbefore        sd_unhealthy   i.strata highereduc3 pre_disability_visit_all_dm2 pre_mobile_visit_all_dm2 pre_trust_visit_all_dm2 visit_all_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est6: areg p_5mafter          pre_disability_sd_unhealthy  pre_mobile_sd_unhealthy  pre_trust_sd_unhealthy sd_unhealthy pre_disability pre_mobile pre_trust i.strata p_1mbefore p2016_dm highereduc3 pre_disability_visit_all_dm2 pre_mobile_visit_all_dm2 pre_trust_visit_all_dm2 visit_all_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)




esttab  using "final/adverse_interaction_withremoteness_head.tex", replace  se order(pre_disability pre_mobile pre_trust life_expect_ng *life_expect_ng sd_healthshock *sd_healthshock sd_unhealthy *sd_unhealthy *cdist_dm2)  posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap   keep(life_expect_ng sd_healthshock sd_unhealthy pre_disability* pre_trust* pre_mobile* ) drop(*visit_all_dm2)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/adverse_interaction_withremoteness_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/adverse_interaction_withremoteness_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= *strata"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm"  "District Fixed Effects= _cons" "Higher Education = highereduc3*"  "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"    "(Treatments *) Remoteness Dummy (Frequency)= *visit_all_dm2" ) 
esttab  using "final/adverse_interaction_withremoteness_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(N ncluster,labels("Observations" "N of Subdistricts"))



eststo clear

eststo est1: areg p_1mbefore        life_expect_ng   i.strata highereduc3 pre_disability_cdist_dm2 pre_mobile_cdist_dm2 pre_trust_cdist_dm2 cdist_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est2: areg p_5mafter          pre_disability_life_expect_ng  pre_mobile_life_expect_ng  pre_trust_life_expect_ng life_expect_ng pre_disability pre_mobile pre_trust i.strata p_1mbefore p2016_dm highereduc3 pre_disability_cdist_dm2 pre_mobile_cdist_dm2 pre_trust_cdist_dm2 cdist_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo est3: areg p_1mbefore        sd_healthshock   i.strata highereduc3 pre_disability_cdist_dm2 pre_mobile_cdist_dm2 pre_trust_cdist_dm2 cdist_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est4: areg p_5mafter          pre_disability_sd_healthshock  pre_mobile_sd_healthshock  pre_trust_sd_healthshock sd_healthshock pre_disability pre_mobile pre_trust i.strata p_1mbefore p2016_dm highereduc3 pre_disability_cdist_dm2 pre_mobile_cdist_dm2 pre_trust_cdist_dm2 cdist_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est5: areg p_1mbefore        sd_unhealthy   i.strata highereduc3 pre_disability_cdist_dm2 pre_mobile_cdist_dm2 pre_trust_cdist_dm2 cdist_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)


eststo est6: areg p_5mafter          pre_disability_sd_unhealthy  pre_mobile_sd_unhealthy  pre_trust_sd_unhealthy sd_unhealthy pre_disability pre_mobile pre_trust i.strata p_1mbefore p2016_dm highereduc3 pre_disability_cdist_dm2 pre_mobile_cdist_dm2 pre_trust_cdist_dm2 cdist_dm2 `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 , ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)




esttab  using "final/adverse_interaction_withremoteness2_head.tex", replace  se order(pre_disability pre_mobile pre_trust life_expect_ng *life_expect_ng sd_healthshock *sd_healthshock sd_unhealthy *sd_unhealthy *cdist_dm2)  posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap   keep(life_expect_ng sd_healthshock sd_unhealthy pre_disability* pre_trust* pre_mobile* )  drop(*cdist_dm2) stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/adverse_interaction_withremoteness2_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/adverse_interaction_withremoteness2_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= *strata"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm"  "District Fixed Effects= _cons" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"    "(Treatments *) Remoteness Dummy (Distance)= *cdist_dm2") 
esttab  using "final/adverse_interaction_withremoteness2_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(N ncluster,labels("Observations" "N of Subdistricts"))






* "External Validity: Heterogeneity in Unbalanced Variables"



eststo clear


eststo est1: areg p_5mafter pre_disability pre_disability_sd_educ_tocomp pre_mobile pre_mobile_sd_educ_tocomp pre_trust pre_trust_sd_educ_tocomp sd_educ_tocomp i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo est2: areg p_5mafter pre_disability pre_disability_sd_age pre_mobile pre_mobile_sd_age pre_trust pre_trust_sd_age sd_age i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo est3: areg p_5mafter pre_disability pre_disability_mobilephone pre_mobile pre_mobile_mobilephone pre_trust pre_trust_mobilephone mobilephone i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo est4: areg p_5mafter pre_disability pre_disability_sd_qs4_15_d pre_mobile pre_mobile_sd_qs4_15_d pre_trust pre_trust_sd_qs4_15_d sd_qs4_15_d i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

eststo est5: areg p_5mafter pre_disability pre_disability_sd_qs4_15_e pre_mobile pre_mobile_sd_qs4_15_e pre_trust pre_trust_sd_qs4_15_e sd_qs4_15_e i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
eststo est6: areg p_5mafter pre_disability pre_disability_hospitalization pre_mobile pre_mobile_hospitalization pre_trust pre_trust_hospitalization hospitalization i.strata p_1mbefore p2016_dm `unbalance_ind' `howexperiment' if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=7 ,ro absorb(s_Soum_ID) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

foreach var of varlist sd_age sd_educ_tocomp mobilephone sd_qs4_15_d sd_qs4_15_e hospitalization{
	local mpglist `mpglist' `var' x  pre_disability_`var' pre_disability_x pre_mobile_`var' pre_mobile_x pre_trust_`var' pre_trust_x
}



esttab  using "final/externalvalidity_sd.tex",  rename(`mpglist') coeflabel(x X pre_disability_x "Disability * X" pre_mobile_x "Mobile * X" pre_trust_x "Trust * X")  replace scalar("rpint1 Rand-t for X_i*Disability" "rpint2 Rand-t for X_i*Mobile" "rpint3 Rand-t for X_i*Trust")  se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= *strata" "District Fixed Effects= _cons"  "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "Higher Education = highereduc3*" ) 


esttab  using "final/externalvalidity_sd_head.tex", replace  se rename(`mpglist') coeflabel(x X pre_disability_x "Disability * X" pre_mobile_x "Mobile * X" pre_trust_x "Trust * X")  posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability* pre_trust* pre_mobile*) order(pre_disability pre_mobile pre_trust) stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/externalvalidity_sd_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/externalvalidity_sd_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= *strata"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm"  "District Fixed Effects= _cons" "Higher Education = highereduc3*" "X = sd* mobilephone hospitalization") 
esttab  using "final/externalvalidity_sd_foot.tex" , append  se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(N ncluster,labels("Observations" "N of Subdistricts"))



****


use intermediate/confidential/finaldata.dta,clear
append using intermediate/confidential/data_for_analysis_droppedfromanalysis.dta

foreach var of varlist s4 athome p_1mbefore p2016_dm highereduc3  female age job visit_all_dm2{

drop `var'_mv `var'_mvdum
}

foreach var of varlist s4 athome p_1mbefore p2016_dm highereduc3  female age job visit_all_dm2{
gen `var'_mv = `var'
replace `var'_mv = 0 if `var' == .

gen `var'_mvdum = `var' == .

}
* "Including the Sample Dropped from the Main Result Because of an ID Mismatch" different eststo



* Main Result *different eststo

eststo clear
eststo: areg p_5mafter pre_disability pre_mobile pre_trust   if   pre_intervention!=.& vol==1 & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est1
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) reg p_5mafter pre_disability pre_mobile pre_trust  if   pre_intervention!=.& vol==1 & s4>=3&s4<=7 ,ro  cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est1
estadd scalar rpint2 = test[2,5]: est1
estadd scalar rpint3 = test[3,5]: est1


eststo: reg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm  i.strata if   pre_intervention!=.& vol==1 & s4>=3&s4<=7 ,ro  cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est2
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)

randcmd ((pre_disability pre_mobile pre_trust ) reg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.strata if   pre_intervention!=.& vol==1 & s4>=3&s4<=7 ,ro  cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est2
estadd scalar rpint2 = test[2,5]: est2
estadd scalar rpint3 = test[3,5]: est2

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID if   pre_intervention!=.& vol==1 & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est3
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm  i.s_Soum_ID if   pre_intervention!=.& vol==1 & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est3
estadd scalar rpint2 = test[2,5]: est3
estadd scalar rpint3 = test[3,5]: est3

eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' if   pre_intervention!=.& vol==1 & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est4
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' if   pre_intervention!=.& vol==1 & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est4
estadd scalar rpint2 = test[2,5]: est4
estadd scalar rpint3 = test[3,5]: est4


eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  pre_intervention!=.& vol==1  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est5
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' if  pre_intervention!=.& vol==1  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est5
estadd scalar rpint2 = test[2,5]: est5
estadd scalar rpint3 = test[3,5]: est5




eststo: areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' `other_ind' if  pre_intervention!=.& vol==1  & s4>=3&s4<=7, ro absorb(strata) cluster(s_Bag_ID)
estadd scalar ncluster = e(N_clust): est6
sum `e(depvar)' if e(sample) & pre_intervention == 5
estadd scalar mean= r(mean)
randcmd ((pre_disability pre_mobile pre_trust ) areg p_5mafter pre_disability pre_mobile pre_trust  p_1mbefore p2016_dm i.s_Soum_ID `unbalance_ind' `howexperiment' `other_ind' if  pre_intervention!=.& vol==1  & s4>=3&s4<=7 ,ro absorb(strata) cluster(s_Bag_ID)),treatvars(pre_disability pre_mobile pre_trust ) groupvar(s_Bag_ID) strata(strata)
matrix test = e(RCoef)  
estadd scalar rpint1 = test[1,5]: est6
estadd scalar rpint2 = test[2,5]: est6
estadd scalar rpint3 = test[3,5]: est6



esttab  using "final/main_nodrop.tex", replace scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se b(%5.4f) r2 label nogaps starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) nobaselevels indicate("Strata Fixed Effects= _cons" "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*"  "Female= *female*" "Age= age*" ) 
esttab  using "final/main_nodrop_head.tex", replace  se   posthead("") collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  keep(pre_disability pre_trust pre_mobile)  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab  using "final/main_nodrop_foot.tex" , replace  stats(mean, labels("Mean Outcome in the Control Group")) se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") 
esttab  using "final/main_nodrop_foot.tex", append  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(,labels()) indicate("Strata Fixed Effects= _cons"   "Contribution One Month Before = p_1mbefore"  "Any Contribution in 2016 = *p2016_dm" "District Fixed Effects= *s_Soum_ID" "Higher Education = highereduc3*" "Occupation Dummies = *job*" "Remoteness (Frequency) = visit_all_dm2*" "Treatment Month Dummies = *s4*" "Treatment at Home = athome*" "Female = female*" "Age = age*") 
esttab  using "final/main_nodrop_foot.tex" , append  scalar("rpint1 Rand-t for Disability" "rpint2 Rand-t for Mobile" "rpint3 Rand-t for Trust") se  collabels(none) nonumbers nomtitles nocons  eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(rpint1  rpint2 rpint3 N ncluster,labels("Rand-t for Disability" "Rand-t for Mobile" "Rand-t for Trust" "Observations" "N of Subdistricts"))






*** HSES

tempfile livestock  ourdata


use intermediate/confidential/finaldata.dta,clear


save `ourdata',replace


use  "rawdata/confidential/HSES/2016/03_Livestock.dta",clear
keep q0502a identif ani_id
reshape wide q0502a, i(identif) j(ani_id) 
save `livestock',replace


use "rawdata/confidential/HSES/2016/basicvars.dta", clear

merge 1:1 identif using  "rawdata/confidential/HSES/2016/01_Household.dta",nogen


merge 1:m identif using  "rawdata/confidential/HSES/2016/02_Individual.dta",nogen



merge m:1 identif using `livestock' ,nogen


* Keep non-urban 

keep if urban==2


* keep if selfemployed
keep if q0405==3|q0405==4

* age restriction
gen age = q0105y
keep if age >=17&age<60

* mobilephone

gen qs1_5 = .
* yes
replace qs1_5 = 1 if q0930==2|q0930==3

*no
replace qs1_5 = 2 if q0930==1|q0930==4

gen mobilephone = qs1_5==1 if qs1_5!=.

*hospitalization
gen hospitalization = .
replace hospitalization = q0315 ==1

* Education variable
tab q0210,nolabel
gen educ_tocomp = q0210


* Cattle variables
foreach n of numlist 1 2 3 {
di "letter `n' is ``n''"
local alpha = word("`c(alpha)'", `n')
gen qs4_15_`alpha' = .
replace qs4_15_`alpha' = 1 if q0502a`n' ==0
replace qs4_15_`alpha' = 2 if q0502a`n' >0
replace qs4_15_`alpha' = 3 if q0502a`n' >3
replace qs4_15_`alpha' = 4 if q0502a`n' >6
replace qs4_15_`alpha' = 5 if q0502a`n' >10
replace qs4_15_`alpha' = 6 if q0502a`n' >20
replace qs4_15_`alpha' = 7 if q0502a`n' >40
replace qs4_15_`alpha' = . if q0502a`n' ==.
}


foreach n of numlist 4 5 {
di "letter `n' is ``n''"
local alpha = word("`c(alpha)'", `n')

gen qs4_15_`alpha' = .
replace qs4_15_`alpha' = 1 if q0502a`n' ==0
replace qs4_15_`alpha' = 2 if q0502a`n' >0
replace qs4_15_`alpha' = 3 if q0502a`n' >3
replace qs4_15_`alpha' = 4 if q0502a`n' >6
replace qs4_15_`alpha' = 5 if q0502a`n' >10
replace qs4_15_`alpha' = 6 if q0502a`n' >20
replace qs4_15_`alpha' = 7 if q0502a`n' >40
replace qs4_15_`alpha' = . if q0502a`n' ==.
}



keep educ_tocomp age mobilephone qs4_15_* identif hhweight hospitalization



append using `ourdata'

gen oursample = IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<7

gen represen = hhweight!=.
replace hhweight = 1 if hhweight==.


label var educ_tocomp "Education"
label var age "Age"

label var qs4_15_a "Cattle"
label var qs4_15_b "Horse"
label var qs4_15_c "Camel"
label var qs4_15_d "Sheep"
label var qs4_15_e "Goat"
label var hospitalization "Hospitalization"

label var mobilephone "Mobile Phone Dummy"

label var oursample "Our Sample"



eststo clear
foreach var of varlist  educ_tocomp age mobilephone qs4_15_d qs4_15_e hospitalization{
eststo: regress `var' oursample [pw=hhweight] if oursample==1|represen==1,robust
}
esttab using "final/representativeness.tex",label se  replace
esttab using "final/representativeness_head.tex",replace  se  keep(oursample _cons) posthead("") collabels(none) nomtitles nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap  stats(, labels()) starlevels(\sym{*} 0.1 \sym{**} 0.05 \sym{***} 0.01 ) label
esttab using "final/representativeness_foot.tex",replace  se  collabels(none) nomtitles nocons nonumbers eqlabels("") prehead("") postfoot("") prefoot("") nonotes nogap keep("") posthead("") stats(N,labels("Observations")) 



*** median distributions


use intermediate/confidential/finaldata.dta,clear
tab qs1_6 ja_fr_dm,nolabel
label var qs1_6 "To what extent do you feel friendship with Japan?"


cumul qs1_6 if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8,generate(qs1_6_cum) equal
* graph bar  qs1_6_cum,over(qs1_6)  xtitle(,size(large)) yline(0.5) 
duplicates drop qs1_6_cum qs1_6,force
graph twoway bar  qs1_6_cum qs1_6,  xtitle(,size(large)) yline(0.5 1,lcolor(gs10)) ytitle(Cumulative Density,size(large)) barwidth(0.5) xline(1.5,lpattern(line)) yscale(r(0 (0.5) 1)) ylabel(0 0.25 0.5 0.75 1)  xlabel(1 "Very much" 2 "Somewhat" 3 "Not so much" )
graph export final/dummy_median_qs1_6.eps,replace


use intermediate/confidential/finaldata.dta,clear
tab qs1_7 ja_tr_dm,nolabel
label var qs1_7 "Do you think Japan is a trustworthy country?"
cumul qs1_7 if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8,generate(qs1_7_cum) equal
* graph bar  qs1_7_cum,over(qs1_7)  xtitle(,size(large)) yline(0.5) 
duplicates drop qs1_7_cum qs1_7,force
graph twoway bar  qs1_7_cum qs1_7,  xtitle(,size(large)) yline(0.5 1,lcolor(gs10)) ytitle(Cumulative Density,size(large)) barwidth(0.5) xline(1.5,lpattern(line)) yscale(r(0 (0.5) 1)) ylabel(0 0.25 0.5 0.75 1)  xlabel(1 "Very much" 2 "Somewhat" 3 "Neutral" 4 "Not so much" 5 "Not at all")
graph export final/dummy_median_qs1_7.eps,replace



use intermediate/confidential/finaldata.dta,clear

label var qs5_10 "Do you believe that you can receive the pension contribution in the future as promised?"
tab qs5_10 pen_expect_dm,nolabel


cumul qs5_10 if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8,generate(qs5_10_cum) equal
* graph bar  qs5_10_cum,over(qs5_10)  xtitle(,size(large)) yline(0.5) 
duplicates drop qs5_10_cum qs5_10,force
graph twoway bar  qs5_10_cum qs5_10,  xtitle(,size(large)) yline(0.5 1,lcolor(gs10)) ytitle(Cumulative Density,size(large)) barwidth(0.5) xline(1.5 ,lpattern(line)) yscale(r(0 (0.5) 1)) ylabel(0 0.25 0.5 0.75 1) xtitle("Do you believe that you can receive the pension contribution"  "in the future as promised?",size(large)) xlabel(1 "Strongly yes" 2 "Yes" 3 "Not so much" 4 "Not at all")
graph export final/dummy_median_qs5_10.eps,replace


*** generate aggregated data
use intermediate/confidential/finaldata.dta,clear
keep if  IDmt1==1 & vol==1 & dplc_s1==0  & s4>=3&s4<=8 & p_5mafter!=.
gen weight = 1 

tab s4,gen(s4_)
tab job,gen(job_)

drop if strata==. | s_Bag_ID==.

collapse (mean) p_5mafter pre_disability pre_mobile pre_trust  pre_intervention athome p_1mbefore p2016_dm highereduc3 female age s4_* job_* pre_trust_visit_all_dm pre_disability_visit_all_dm pre_mobile_visit_all_dm visit_all_dm  pre_trust_ja_tr_dm pre_disability_ja_tr_dm pre_mobile_ja_tr_dm ja_tr_dm (sum) weight,by(s_Soum_ID s_Bag_ID strata)

save intermediate/aggregated.dta,replace

